Unit testing plays a significant role in assuring the quality of the applications we develop. To unit test an ASP.Net 5 RC1 Update1 (ASP.Net Core 1.0 now), web application we can use xUnit.
To add xUnit test to the solution add a Class Library (Package) project.
Edit the default project.json shown below.
Add dependency to the ASP.Net 5 web project, and to xUnit and xUnit.Runner.Final project.json should be similar to below.
Once the project.json saved the references get updated.
Let’s write a test for a very simple controller method.
Test method as a Fact (There are two types of Unit Tests in xUnit. Fact and Theory. More information here).
Go to test explorer in VS to view the test.
If you cannot see test as above build your solution. Test will be then available in the explorer. Execute and you can see the results.
Next post let’s learn how to run the unit tests (xUnit), with VS Team Service build and publish test results.
Resolve MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.0-rc4-004771\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found or Unable to start the process. No executable found matching command "dotnet-projectmodel-server"You might encounter compilation error in Visual Studio 2015 when a new .NET Core 1 web app is created, if you have installed Visual Studio 2...
It is great if the latest updates to TFS can be applied as and when they are released. But for a large organization it might not be sometime...
TFS 2018 RC1 is now available and you can download it from https://www.visualstudio.com/downloads/ . Release note here explains the new fea...
This extension “ Chamindac.vsts.release.task.download-artifacts ” for VSTS and TFS 2015.2.1 upwards, can be used to filter for build artifac...
You needed to setup dedicated machines for testing when using Run Functional Tests and you had to execute, Deploy Test Agent step and Copy...