I love to keep up with all things Scott Hanselman ... he's really the golden god of tech.
I love to keep up with all things Scott Hanselman, he's really a golden god of the tech.
I've been learning the new dotnet core stuff lately brushing up on my skills and came across his command line tutorial which is a great into into how you use the dotnet command line.
I'm going to shorten it up for my purposes as I'd like to reference back to it as I keep my studies up. Here's the list of command and what they mean:
md testexample & cd testexample
dotnet new sln
dotnet new classlib -n mylibrary -o mylibrary
dotnet new xunit -n mytests -o mytests
dotnet sln add mylibrary\mylibrary.csproj
dotnet sln add mytests\mytests.csproj
dotnet sln add mytests\mytests.csproj
cd mytests dotnet add reference ..\mylibrary\mylibrary.csproj
cd .. dotnet restore
cd mytests & dotnet test
<ItemGroup> <DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.0.0" /> </ItemGroup>
cd .. dotnet restore
[Fact] public void Test1() { Assert.Equal(4, Add(2,2)); } [Fact] public void Test2() { Assert.Equal(7, Add(4,2)); } int Add(int x, int y) { return x + y; }