Dot net Cli Flashcards

1
Q

To create a new dot net solution

A

dotnet new sln

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

to create the source project

A

dotnet new classlib

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

To add project to a solution

A

dotnet sln add PrimeService/PrimeService.csproj to add the class library project to the solution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Create the test project

A

dotnet new mstest
The dotnet new command creates a test project that uses MSTest as the test library. The generated template configures the test runner in the PrimeServiceTests.csproj file:

XML

Copy

he test project requires other packages to create and run unit tests. dotnet new in the previous step added the MSTest SDK, the MSTest test framework, and the MSTest runner.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Add Reference to a project

A

Now, add the PrimeService class library as another dependency to the project. Use the dotnet add reference command:

.NET Core CLI

Copy
dotnet add reference ../PrimeService/PrimeService.csproj

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

To Run Tests

A

The dotnet test command runs a build for the PrimeService project and then for the PrimeService.Tests project. After building both projects, it runs this single test. It passes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly