Unit test hinzugefügt

This commit is contained in:
Holger Boerchers
2018-08-19 21:37:03 +02:00
parent d7e6dcc3b2
commit fed5a3b443
17 changed files with 115 additions and 59 deletions

View 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);
}
}
}

View 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>

View File

@ -0,0 +1,9 @@
using SmallInjectorDemo;
namespace InjectorTest
{
public class TestClock : IClock
{
public string CurrentDateTime => "-";
}
}