Currently the method only throws an exception. So let’s create the implementation. Update the code accordingly. Time to rerun the test! Since the paramater sent is 1 and the Assert checks if the bool IsFalse the test passes. There you go! Now go and write some tests!
Like I said, I’m a big fan of testing so let’s write a test! Right click on the test project and create a new Class file named PrimeService_IsPrimeShould.cs Write the code from here to create your first test! Awespme! This code creates an object from the class PrimeSerivce and calls the method IsPrime with the […]
So now it’s time to create the test project and add to our solution file! Create the new folder and step into it. Create the mstest project. Now add a reference to the Primeservice-project in the test-project. Finally add the test-project to the unit testing solution. Awesome! All done. Now in the next post we’ll […]