TestBox : Behavior Driven Development (BDD)
API DocsSourceSupportBoxLang
v6.x
v6.x
  • Introduction
    • Release History
      • What's New With 6.3.0
      • What's New With 6.2.1
      • What's New With 6.2.0
      • What's New With 6.1.0
      • What's New With 6.0.1
      • What's New With 6.0.0
    • About This Book
      • Author
  • Getting Started
    • Overview
    • Installation
      • IDE Tools
      • MXUnit Compatibility
    • Writing Tests
    • Running Tests
      • BoxLang CLI Runner
      • CommandBox Runner
      • Web Runner
      • Bundle(s) Runner
      • Directory Runner
      • ANT Runner
      • NodeJS Runner
      • Global Runner
      • Test Browser
    • BDD Tests
      • Bundles: Group Your Tests
      • Suites: Describe Your Tests
        • Dynamic Suites
      • Specs
      • Expectations
      • Suite Groups
        • Given-When-Then Blocks
      • Life-Cycle Methods
      • Life-Cycle Data Binding
      • Specs and Suite Labels
      • Skipping Specs and Suites
      • Focused Specs and Suites
      • Spies & Mocking
      • Asynchronous Testing
      • Running Tests
      • Reporters
    • xUnit Tests
      • Test Bundles
      • Life-Cycle Methods
      • Test Methods
      • Assertions
      • Test and Suite Labels
      • Skipping Tests and Suites
      • Spies and Mocking
      • Asynchronous-Testing
      • Running Tests
      • Reporters
  • Digging Deeper
    • Life-Cycle Annotations
    • Assertions
      • Custom Assertions
    • Expectations
      • Matchers
      • Not Operator
      • Expecting Exceptions
      • Custom Matchers
    • Output Utilities
    • Runner Listeners
    • Reporters
      • Custom Reporters
    • Modules
    • Code Coverage
      • Running Code Coverage
      • Configuring Code Coverage
      • Known Behaviors
    • Continous Integration
      • Github Actions
      • Gitlab
      • Travis
  • Mocking
    • MockBox
      • What is Mocking?
      • Our Approach and Benefits
      • Creating MockBox
      • Creating a Mock Object
      • Creating a Stub Object
      • Mocking Methods
        • $() Method
        • $args() Method
        • $getProperty() Method
        • $property() Method
        • $querySim() Method
        • $results() Method
        • $spy()
        • $throws() Method
      • Verification Methods
        • $count()
        • $times() or $verifyCallCount()
        • $never()
        • $atLeast()
        • $once()
        • $atMost()
        • $callLog()
        • $reset()
        • $debug()
      • Some Examples
      • Conclusion
    • Mocking Data
Powered by GitBook

Social Media

  • YouTube
  • x
  • FaceBook
  • LinkedIn

Downloads

  • CommandBox
  • BoxLang
  • Try BoxLang

Support

  • Professional
  • Community
  • Slack
  • CFCasts

Copyright & Register Trademark by Ortus Solutions, Corp & Ortus Software, LLC

On this page
  • TestBox BDD v6.x
  • Features At A Glance
  • Versioning
  • License
  • Discussion & Help
  • Reporting a Bug
  • Professional Open Source
  • Resources

Was this helpful?

Edit on GitHub
Export as PDF

Introduction

TestBox is a next-generation testing framework based on BDD (Behavior Driven Development) and TDD (Test Driven Development), providing a clean, obvious syntax for writing tests.

NextRelease History

Last updated 7 months ago

Was this helpful?

TestBox BDD v6.x

TestBox is a next-generation testing framework for the JVM language and ColdFusion (CFML) based on (Behavior Driven Development) for providing a clean, obvious syntax for writing tests. It contains not only a testing framework, console/web runner, assertions, and expectations library but also ships with MockBox, A mocking and stubbing companion.

class{

  function run(){
  	describe( "My calculator features", () => {
	
		beforeEach( () => {
			variables.calc = new Calculator()
		} )
			
		// Using expectations library
		it( "can add", () => {
			expect( calc.add(1,1) ).toBe( 2 )
		} )
		
		// Using assert library
		test( "it can multiply", () => {
			assertIsEqual( calc.multiply(2,2), 4 )
		} )
	} )
  }

}
/**
 * My calculator features
 */
class{

	property calc;
	
	function setup(){
	    calc = new Calculator()
	}
	
	// Function name includes the word 'test'
	// Using expectations library
	function testAdd(){
	    expect( calc.add(1,1) ).toBe( 2 )
	}
		
	// Any name, but with a test annotation
	// Using assertions library
	@test
	function itCanMultiply(){
	    $assert.isEqual( calc.multiply(2,2), 4 )
	}
}
component{

  function run(){
  	describe( "My calculator features", () => {
	
		beforeEach( () => {
			variables.calc = new Calculator()
		} );
			
		// Using expectations library
		it( "can add", () => {
			expect( calc.add(1,1) ).toBe( 2 )
		} );
		
		// Using assert library
		test( "it can multiply", () => {
			$assert.isEqual( calc.multiply(2,2), 4 )
		} );
	} );
  }

}
/**
 * My calculator features
 */
component{
	
	property calc;
	
	function setup(){
	    calc = new Calculator()
	}
	
	// Function name includes the word 'test'
	// Using expectations library
	function testAdd(){
	    expect( calc.add(1,1) ).toBe( 2 )
	}
		
	// Any name, but with a test annotation
	// Using assertions library
	function itCanMultiply() test{
	    $assert.isEqual( calc.multiply(2,2), 4 )
	}
}

Features At A Glance

Here is a simple listing of features TestBox brings to the table:

  • BDD style or xUnit style testing

  • Testing life-cycle methods

  • Mocking data library for mocking JSON/complex data and relationships

  • Ability to extend and create custom test runners and reporters

  • Extensible reporters, bundled with tons of them:

    • JSON

    • XML

    • JUnit XML

    • Text

    • Console

    • Simple HTML

    • Min - Minimalistic Heaven

    • Raw

    • CommandBox

  • Asynchronous testing

  • Multi-suite capabilities

  • Test skipping

  • Test labels and tagging

  • Testing debug output stream

  • Much more!

Versioning

<major>.<minor>.<patch>

And constructed with the following guidelines:

  • bumpBreaking backward compatibility bumps the major (and resets the minor and patch)

  • New additions without breaking backward compatibility bump the minor (and resets the patch)

  • Bug fixes and misc changes bump the patch

License

  • Copyright by Ortus Solutions, Corp

  • TestBox is a registered trademark by Ortus Solutions, Corp

The ColdBox Websites, Documentation, logo, and content have a separate license, and they are separate entities.

Discussion & Help

Reporting a Bug

Professional Open Source

  • Custom Development

  • Professional Support & Mentoring

  • Training

  • Server Tuning

  • Security Hardening

  • Code Reviews

Resources

HONOR GOES TO GOD ABOVE ALL

Because of His grace, this project exists. If you don't like this, don't read it, it's not for you.

Therefore being justified by faith, we have peace with God through our Lord Jesus Christ: By whom also we have access by faith into this grace wherein we stand, and rejoice in hope of the glory of God. - Romans 5:5

integration for mocking and stubbing

TAP ()

Code Coverage via

TestBox is maintained under the guidelines as much as possible. Releases will be numbered in the following format:

TestBox is open source and licensed under the License. If you use it, please try to mention it in your code or website.

Help Group:

BoxTeam Slack :

We all make mistakes from time to time :) So why not let us know about it and help us out? We also love pull requests, so please star us and fork us:

By Jira:

TestBox is a professional open source software backed by offering services like:

Official Site:

Current API Docs:

Help Group:

Source Code:

Bug Tracker:

Twitter:

Facebook:

MockBox
Test Anything Protocol
FusionReactor
Semantic Versioning
Apache 2
https://community.ortussolutions.com/c/communities/testbox/11
https://boxteam.ortussolutions.com
https://github.com/Ortus-Solutions/TestBox
https://ortussolutions.atlassian.net/browse/TESTBOX
Ortus Solutions, Corp
Much More
https://www.ortussolutions.com/products/testbox
https://apidocs.ortussolutions.com/testbox/current
https://community.ortussolutions.com/c/communities/testbox/11
https://github.com/Ortus-Solutions/TestBox
https://ortussolutions.atlassian.net/browse/TESTBOX
@ortussolutions
https://www.facebook.com/ortussolutions
BoxLang
BDD
Runner
Ortus Solutions, Corp