Unit test hinzugefügt
This commit is contained in:
18
InjectorTest/HelperTest.cs
Normal file
18
InjectorTest/HelperTest.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using SmallInjectorDemo;
|
||||
using Xunit;
|
||||
|
||||
namespace InjectorTest
|
||||
{
|
||||
public class HelperTest
|
||||
{
|
||||
[Fact]
|
||||
public void Test()
|
||||
{
|
||||
const string expected = "[-] HelperTest.Test Id: 0";
|
||||
var actual = Helper.WriteMethodString(new TestClock(), 0);
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
22
InjectorTest/InjectorTest.csproj
Normal file
22
InjectorTest/InjectorTest.csproj
Normal file
@ -0,0 +1,22 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SmallInjectorDemo\SmallInjectorDemo.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
9
InjectorTest/TestClock.cs
Normal file
9
InjectorTest/TestClock.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using SmallInjectorDemo;
|
||||
|
||||
namespace InjectorTest
|
||||
{
|
||||
public class TestClock : IClock
|
||||
{
|
||||
public string CurrentDateTime => "-";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user