-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add unit test, provide namespace config
- Loading branch information
1 parent
00e9a6e
commit 9206f58
Showing
7 changed files
with
153 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" /> | ||
<PackageReference Include="xunit" Version="2.4.1" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="coverlet.collector" Version="3.1.2"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Arrowgene.Logging\Arrowgene.Logging.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using Xunit; | ||
|
||
namespace Arrowgene.Logging.Test; | ||
|
||
public class LogProviderTest | ||
{ | ||
private class TestNsLogger : TestLogger | ||
{ | ||
public override void Initialize(string identity, string name, Action<Log> write, object loggerTypeTag, | ||
object identityTag) | ||
{ | ||
Assert.Equal("Arrowgene.Logging.Test", identityTag); | ||
} | ||
} | ||
|
||
[Fact] | ||
public void TestNsResolution() | ||
{ | ||
LogProvider.ConfigureNamespace("Arrowgene.Logging.Test", "Arrowgene.Logging.Test"); | ||
LogProvider.Logger<TestNsLogger>(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
|
||
namespace Arrowgene.Logging.Test; | ||
|
||
public class TestLogger : ILogger | ||
{ | ||
public virtual void Initialize(string identity, string name, Action<Log> write, object loggerTypeTag, object identityTag) | ||
{ | ||
} | ||
|
||
public virtual void Write(LogLevel logLevel, string message, object tag) | ||
{ | ||
} | ||
|
||
public virtual void Trace(string message) | ||
{ | ||
} | ||
|
||
public virtual void Info(string message) | ||
{ | ||
} | ||
|
||
public virtual void Debug(string message) | ||
{ | ||
} | ||
|
||
public virtual void Error(string message) | ||
{ | ||
} | ||
|
||
public virtual void Exception(Exception exception) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters