TESTBOX: A FLUENT AND FUNCTIONAL TESTING FRAMEWORK FOR
& CFML
- 1,674,000 Installs
- 5.4.0+7 Version
- 19,119 Views
TestBox is a next-generation testing framework for the BoxLang JVM language and ColdFusion (CFML) based on BDD (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.
Installation
You can start quickly with TestBox in your applications by leveraging CommandBox, our CLI and package manager. Follow the simple commands below to install the latest stable or bleeding edge version of TestBox.
// Install latest stable version
box install testbox —saveDev
// Install bleeding edge version
box install testbox@be —saveDev
You can also visit Visit https://testbox.ortusbooks.com/getting-started/overview for a quick reference guide.
Beautiful Syntax For BDD / xUnit
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(){
assertIsEqual( 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 )
}
}
Beautiful & Customizable Reports
Get Expert Support with Your TestBox Projects:
Need assistance troubleshooting TestBox? Our dedicated support team is here to answer your questions and ensure your projects run smoothly. We offer various support options to fit your needs, from quick answers to in-depth consultations.
Get Help NowMaster TestBox with Comprehensive Training:
Unlock the full potential of TestBox with our comprehensive training programs. We offer a variety of options, from beginner-friendly tutorials to advanced workshops. Enhance your skills, optimize your testing processes, and become a TestBox pro.
CBOX-205 : BDD & TDD CFML Development
CBOX-205 is one of our core courses that focus on testing principles, TDD (Test Driven Development), BDD (Behavior Driven Development), mocking and automation. Read More +
CBOX-205 : BDD & TDD CFML Development
CBOX-205 is one of our core courses that focus on testing principles, TDD (Test Driven Development), BDD (Behavior Driven Development), mocking and automation. Read More +
2 days | 16 hours
Beginner
Min. Students: 2
Up to 5 Students