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 argument set to 1.
Since our IsPrime method currently throws an exception the test will fail.
In the solution folder run the test and watch what happens!
dotnet test

Ouch! Failed! Now in the final post we’ll rewrite the method so that the test will pass!