This is the continuation of our first article:
Preview
In this article, we will learn how to add a test project into our application and do automation tests for a class library project, which is created using .NET Core.
Step 1
In this article, we will learn how to add a test project into our application and do automation tests for a class library project, which is created using .NET Core.
Step 1
Add Test Project to our solution
We will refer to the same solution to add our test project. Right click on Solution file and add new solution folder with the name “DotNetCoreTest”.


Step 2
We will refer to the same solution to add our test project. Right click on Solution file and add new solution folder with the name “DotNetCoreTest”.


Step 2
Add new console application under “DotNetCoreTest” folder
Right click on “DotNetCoreTest” folder and add new project.

Select .NET Core from the left panel and click “Console Application (.NET Core)”. Give the name “TestLibrary” to our new project and click OK button.

A new project with the name “TestLibrary” will be added under the folder “DotNetCoreTest”.

Step 3
Right click on “DotNetCoreTest” folder and add new project.

Select .NET Core from the left panel and click “Console Application (.NET Core)”. Give the name “TestLibrary” to our new project and click OK button.

A new project with the name “TestLibrary” will be added under the folder “DotNetCoreTest”.

Step 3
Add reference to Class library created using .Net Core
As explained in the previous article, we have created a class library with the name “DotNetCoreDemo” under the src folder.
We need to add the reference of that class library into our TestLibrary project.
Right click on “References” under the “TestLibrary” project and click “Add References..”

Select the DotNetCoreDemo from the list and click OK button. The reference of DotNetCoreDemo project should be added to the list.

Step 4
As explained in the previous article, we have created a class library with the name “DotNetCoreDemo” under the src folder.
We need to add the reference of that class library into our TestLibrary project.
Right click on “References” under the “TestLibrary” project and click “Add References..”

Select the DotNetCoreDemo from the list and click OK button. The reference of DotNetCoreDemo project should be added to the list.

Step 4







Join the conversation! Your thoughts help the community grow.