Simply issue dotnet restore, dotnet run
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
the question is really simple, i'll made a example code space here and you can give answered , Thanks.
vs code ( latest ver )
Program.cs ( in it )
using System;
namespace App
{
class Program
{
static void main(string[] args)
{
Console.Writeline("Main");
}
static void TEST()
{
Console.WriteLine("TEST");
}
}
}
------------------- End of Program.cs File
----------------- Terminal operations
not : For making run the app ( writin in C# ) , Simply do the command of;
username\app> dotnet run
and the result is;
"
Main
"
We okay with that.
WHAT I WANT TO DO IS
how to RUN TEST Method in terminal like;
dotnet run TEST() kinda
Simply issue dotnet restore, dotnet run
in dotnet you create a separate test project. you write your unit tests in this test project. you run the tests with the dotnet test command
to create unit test, create a new class lib. add the NuGet Package for the unit test platform of choice. add a project reference to the project to test. write some unit tests. then run the units test with dotnet test
you can create a solution file (dotnet sln) for both projects, and run the test on the solution. this will build both projects first.
see:
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test