Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to .NET 6 and removes deprecated dependency #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions Whois.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using CommandLine;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Serilog;

namespace Whois
{
Expand All @@ -18,14 +18,12 @@ class Program
/// <param name="args">The args.</param>
private static async Task Main(string[] args)
{
var log = new LoggerConfiguration()
.WriteTo
.Console(outputTemplate: "{Timestamp:HH:mm} [{Level}] {Message}{NewLine}{Exception}")
.MinimumLevel
.Error()
.CreateLogger();

Log.Logger = log;
var loggerFactory = LoggerFactory.Create(builder =>
{
builder.SetMinimumLevel(LogLevel.Trace);
builder.AddConsole(options => options.DisableColors = true);
});
LogProvider.Factory = loggerFactory;

var result = Parser
.Default
Expand Down
8 changes: 4 additions & 4 deletions Whois.Console/Whois.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>Whois.Console</AssemblyName>
<RootNamespace>Whois</RootNamespace>
<PackAsTool>true</PackAsTool>
Expand All @@ -13,14 +13,14 @@
<Authors>Chris Wood</Authors>
<Company>flipbit.co.uk</Company>
<Product>.NET WHOIS Lookup</Product>
<LangVersion>default</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Serilog" Version="2.11.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Whois.Tests.Integration/SampleReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal class SampleReader
{
public List<SampleDomain> ReadSampleDomains()
{
var json = File.ReadAllText(Path.Join("..\\..\\..\\Samples", "Domains.txt"));
var json = File.ReadAllText(Path.Join("..", "..", "..", "Samples", "Domains.txt"));

return JsonConvert.DeserializeObject<List<SampleDomain>>(json);
}
Expand Down
3 changes: 2 additions & 1 deletion Whois.Tests.Integration/Whois.Tests.Integration.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Whois</RootNamespace>
<ApplicationIcon />
<OutputType>Library</OutputType>
<StartupObject />
<LangVersion>default</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
Expand Down
18 changes: 18 additions & 0 deletions Whois.Tests/LogConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Microsoft.Extensions.Logging;

namespace Whois
{
class LogConfig
{
public static void Init()
{
// LoggerFactory should be disposed with the test case.
var loggerFactory = LoggerFactory.Create(builder =>
{
builder.SetMinimumLevel(LogLevel.Trace);
builder.AddConsole(options => options.DisableColors = true);
});
LogProvider.Factory = loggerFactory;
}
}
}
2 changes: 1 addition & 1 deletion Whois.Tests/Parsers/WhoisParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class WhoisParserTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
sampleReader = new SampleReader();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class CapetownParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class VgParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class CcParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class CoZaParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class DurbanParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class JoburgParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
2 changes: 1 addition & 1 deletion Whois.Tests/Parsing/kero.yachay.pe/pe/PeParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class PeParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class OrgZaParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class TvParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
2 changes: 1 addition & 1 deletion Whois.Tests/Parsing/whois.aeda.net.ae/ae/AeParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class AeParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class BzParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class GiParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class LcParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class MnParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ScParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class VcParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class InfoParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ProParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
2 changes: 1 addition & 1 deletion Whois.Tests/Parsing/whois.amnic.net/am/AmParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class AmParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
2 changes: 1 addition & 1 deletion Whois.Tests/Parsing/whois.ati.tn/tn/TnParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class TnParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class AuParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
4 changes: 2 additions & 2 deletions Whois.Tests/Parsing/whois.ax/ax/AxParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class AxParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down Expand Up @@ -50,7 +50,7 @@ public void Test_found()


Assert.AreEqual(new DateTime(2006, 8, 3, 0, 0, 0), response.Registered);
Assert.AreEqual("�lands landskapsregering", response.Registrant.Name);
Assert.AreEqual("Ålands landskapsregering", response.Registrant.Name);
Assert.AreEqual("0145076-7", response.Registrant.Organization);

Assert.AreEqual(1, response.Registrant.Address.Count);
Expand Down
2 changes: 1 addition & 1 deletion Whois.Tests/Parsing/whois.biz/biz/BizParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class BizParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
2 changes: 1 addition & 1 deletion Whois.Tests/Parsing/whois.bnnic.bn/bn/BnParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class BnParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
2 changes: 1 addition & 1 deletion Whois.Tests/Parsing/whois.cat/cat/CatParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class CatParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
2 changes: 1 addition & 1 deletion Whois.Tests/Parsing/whois.cctld.by/by/ByParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ByParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
2 changes: 1 addition & 1 deletion Whois.Tests/Parsing/whois.cctld.uz/uz/UzParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class UzParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
2 changes: 1 addition & 1 deletion Whois.Tests/Parsing/whois.cdmon.com/com/ComParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ComParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class AeOrgParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ArComParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class BrComParsingTests : ParsingTests
[SetUp]
public void SetUp()
{
SerilogConfig.Init();
LogConfig.Init();

parser = new WhoisParser();
}
Expand Down
Loading