Developer Docs

Running application tests with C#Bot

There are multiple methods which you can use to run the tests in your C#Bot application. The simplest method is to navigate to the directory in the ‘testtarget’ which contains the tests you want to run (i.e. ‘testtarget/API’, ‘testtarget/Selenium’, ‘testtarget/Serverside’) and running the following command:

dotnet test

However, we recommend running tests through an IDE (Integrated Development Environment). Running the tests through an IDE, as opposed to the command line, gives you a lot more information regarding individual test failures, as well as the ability to set breakpoints to debug test failures. We recommend using an IDE such as Visual Studio, or Rider.

Please note the linked documentation for Visual Studio will be better maintained than this worked example.

Example using Rider

When starting Rider, you can choose to open a Solution or a Project, which will let you choose the solution file for your project:

Image

Once you have imported your project and opened it in Rider, the individual testing projects will all be shown in the sidebar. From here you can open any of them and add additional tests. You can also right click on any of the test projects, and click ‘Run Unit Tests’. This will run all of the tests for that project and display their outputs in the window at the bottom of the IDE.

Image