tests agian

This commit is contained in:
Adam R. Grey 2021-12-09 10:04:44 -05:00
parent becac42720
commit 15a9ba0dde
3 changed files with 57 additions and 3 deletions

15
franz.tests/UnitTest1.cs Normal file
View File

@ -0,0 +1,15 @@
using franz;
using System;
using Xunit;
namespace franz.tests
{
public class UnitTest1
{
[Fact]
public void Test1()
{
Telefranz.Configure("xunit", "focalor:9092");
}
}
}

View File

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../franz/franz.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.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="1.3.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>

View File

@ -1,10 +1,26 @@
using System;
using Kafka.Public;
using Kafka.Public.Loggers; using Kafka.Public.Loggers;
namespace franz namespace franz
{ {
internal class quieterLogger : ConsoleLogger internal class quieterLogger : ILogger
{ {
new public void LogInformation(string message) {} public void LogDebug(string message)
{
Console.WriteLine($"[{DateTime.Now}] [DEBUG]: {message}");
}
public void LogError(string message)
{
Console.Error.WriteLine($"[{DateTime.Now}] [ERROR]: {message}");
}
public void LogInformation(string message)
{
//Console.WriteLine($"[INFO]: {message}");
}
public void LogWarning(string message)
{
Console.WriteLine($"[{DateTime.Now}] [Warning]: {message}");
}
} }
} }