Unit testing C# with MSTest and .NET Core Part 4 – Update the method

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!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: