BDD Framework: How to create your own dynamic test

Print

A BDD integration test is an actual Unity Test Tools Integration Test.

You are going to start the creation of your test. You can do it in two ways:

 

 

 

After adding it, the framework checks the Integration Test for errors. At the very beginning, we are going to have an empty inspector saying: "Please, add your BDD Components and enjoy BDD.". It means, obviously, that we have to add a BDD Component before starting to configure the scenario. If you have not yet the right class to add, you first have to create it. You can just use the empty template called “TemplateDynamicBDD.cs” by copying it in your script folder and renaming the name of the file and the class name.

Now you have to create your BDD Methods. First of all, you have to have the test scenario written in the Given-When-Then format. After that, you can replicate the sentences in your scenario into the BDD Methods.

Now you can add your new script to the integration test:

 

 

After adding the component, the combo boxes on the runner inspector are not set to any value, for two reasons: first there is not yet a BDD Component in your test, and second, the BDD Framework cannot know which methods you want to set. Instead of the scenario sentences, the BDD Framework shows the writing “### Please, choose a method or delete the row. ###". It is just a reminder to set up your test properly, otherwise, you cannot run it.

 

Back to: BDD Framework: how to use it and avoid mistakes Read next: BDD Framework: How to create your own static test