In the previous recipe, you learned how to define the first unit test. However, only one test is not enough to thoroughly test the solution. For this reason, you should specify a set of them as well as run them frequently to ensure that newly introduced changes do not cause any regression, that is, new features do not cause problems with the existing modules. In this recipe, you will learn how to add a few other test cases as well as how to run them to check whether all of them have passed.
To learn how to run a set of tests, perform the following steps:
Create a set of tests to thoroughly test the
ConsumptionCalculator
class. As the second test, let's check whether after adding the correct data, the number of consumption entries is equal to one. The suitable test case is presented in the following code snippet:[TestMethod] public void AddCorrectData_ShouldBeAdded...