Unit testing an application

Microsoft has a proprietary unit testing framework known as MS Test, which is closely integrated with Visual Studio. However, to use a unit testing framework that is compatible with .NET Core, we will use the third-party framework: xUnit.net.

Creating a class library that needs testing with Visual Studio 2017

In Visual Studio 2017, add a new Class Library (.NET Standard) project named Ch05_Calculator, as shown in the following screenshot:

Creating a class library that needs testing with Visual Studio 2017

In Visual Studio 2017, in the Solution Explorer window, right-click on the Class1.cs file and choose Rename. Change its name to Calculator. You will be prompted to rename all references. ...

Get C# 7 and .NET Core now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.