From e16ea4c77e4e3dc8aecf140f37de41b9e3e3c32a Mon Sep 17 00:00:00 2001 From: flipbit Date: Thu, 2 Jun 2022 05:18:54 +0100 Subject: [PATCH 1/6] Update project file versions --- Whois.Console/Whois.Console.csproj | 2 +- .../Whois.Tests.Integration.csproj | 2 +- Whois.Tests/Whois.Tests.csproj | 2 +- Whois/Whois.csproj | 702 +----------------- 4 files changed, 30 insertions(+), 678 deletions(-) diff --git a/Whois.Console/Whois.Console.csproj b/Whois.Console/Whois.Console.csproj index 37386f2e..4c0a689e 100644 --- a/Whois.Console/Whois.Console.csproj +++ b/Whois.Console/Whois.Console.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + net6.0 Whois.Console Whois true diff --git a/Whois.Tests.Integration/Whois.Tests.Integration.csproj b/Whois.Tests.Integration/Whois.Tests.Integration.csproj index 7ba2fec2..cbde425a 100644 --- a/Whois.Tests.Integration/Whois.Tests.Integration.csproj +++ b/Whois.Tests.Integration/Whois.Tests.Integration.csproj @@ -1,6 +1,6 @@  - netcoreapp2.1 + net6.0 Whois Library diff --git a/Whois.Tests/Whois.Tests.csproj b/Whois.Tests/Whois.Tests.csproj index 872a560e..9b0cd365 100644 --- a/Whois.Tests/Whois.Tests.csproj +++ b/Whois.Tests/Whois.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp2.1 + net6.0 Whois Library diff --git a/Whois/Whois.csproj b/Whois/Whois.csproj index 08788122..fed532b0 100644 --- a/Whois/Whois.csproj +++ b/Whois/Whois.csproj @@ -1,694 +1,46 @@  - netstandard2.0;net452 - true - 3.0.1.0 - 3.0.1 - Chris Wood - flipbit.co.uk - http://github.com/flipbit/whois - whois lookup parsing - A .NET Framework 4.5.2 and Standard 2.0 WHOIS Lookup and Parsing Library - Chris Wood 2021 - Whois - + netstandard2.0 + true + 4.0.0.0 + 4.0.0 + Chris Wood + flipbit.co.uk + http://github.com/flipbit/whois + whois lookup parsing + A .NET Standard 2.0 WHOIS Lookup and Parsing Library + Chris Wood 2022 + Whois + latest + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - - all - runtime; build; native; contentfiles; analyzers - - - + + all + runtime; build; native; contentfiles; analyzers + + + - LICENSE.txt + LICENSE.txt - + + From 966cec0c0470d32d500a2791e780527986fc99b5 Mon Sep 17 00:00:00 2001 From: flipbit Date: Thu, 2 Jun 2022 05:19:26 +0100 Subject: [PATCH 2/6] Fix .mx date parsing --- .../Parsing/whois.nic.mx/mx/MxParsingTests.cs | 1 - .../SpanishToDecimalMonthTransformer.cs | 72 +++++++++++++++++++ Whois/Parsers/ToHostNameTransformer.cs | 51 +++++++------ Whois/Parsers/WhoisParser.cs | 2 + Whois/Resources/whois.nic.mx/mx/Found.txt | 12 ++-- 5 files changed, 105 insertions(+), 33 deletions(-) create mode 100644 Whois/Parsers/SpanishToDecimalMonthTransformer.cs diff --git a/Whois.Tests/Parsing/whois.nic.mx/mx/MxParsingTests.cs b/Whois.Tests/Parsing/whois.nic.mx/mx/MxParsingTests.cs index 008df19a..54c0930f 100644 --- a/Whois.Tests/Parsing/whois.nic.mx/mx/MxParsingTests.cs +++ b/Whois.Tests/Parsing/whois.nic.mx/mx/MxParsingTests.cs @@ -162,7 +162,6 @@ public void Test_found_status_registered() Assert.AreEqual("California", response.TechnicalContact.Address[1]); Assert.AreEqual("United States", response.TechnicalContact.Address[2]); - Assert.AreEqual(23, response.FieldsParsed); } } diff --git a/Whois/Parsers/SpanishToDecimalMonthTransformer.cs b/Whois/Parsers/SpanishToDecimalMonthTransformer.cs new file mode 100644 index 00000000..e4ab3168 --- /dev/null +++ b/Whois/Parsers/SpanishToDecimalMonthTransformer.cs @@ -0,0 +1,72 @@ +using System.Text.RegularExpressions; +using Tokens.Transformers; + +namespace Whois.Parsers; + +/// +/// Transforms Spanish month names to their decimal equivalents. +/// +public class SpanishToDecimalMonthTransformer : ITokenTransformer +{ + public bool CanTransform(object value, string[] args, out object transformed) + { + if (value is null) + { + transformed = null; + return false; + } + + var result = value.ToString(); + + result = Replace(result, "ene.", "01"); + result = Replace(result, "ene", "01"); + + result = Replace(result, "feb.", "02"); + result = Replace(result, "feb", "02"); + + result = Replace(result, "mar.", "03"); + result = Replace(result, "mar", "03"); + + result = Replace(result, "abr.", "04"); + result = Replace(result, "abr", "04"); + + result = Replace(result, "may.", "05"); + result = Replace(result, "may", "05"); + + result = Replace(result, "jun.", "06"); + result = Replace(result, "jun", "06"); + + result = Replace(result, "jul.", "07"); + result = Replace(result, "jul", "07"); + + result = Replace(result, "ago.", "08"); + result = Replace(result, "ago", "08"); + + result = Replace(result, "sept.", "09"); + result = Replace(result, "sept", "09"); + + result = Replace(result, "oct.", "10"); + result = Replace(result, "oct", "10"); + + result = Replace(result, "nov.", "11"); + result = Replace(result, "nov", "11"); + + result = Replace(result, "dic.", "12"); + result = Replace(result, "dic", "12"); + + transformed = result; + + return transformed != value; + } + + private static string Replace(string input, string search, string replacement) + { + var result = Regex.Replace( + input, + Regex.Escape(search), + replacement.Replace("$","$$"), + RegexOptions.IgnoreCase + ); + return result; + } +} \ No newline at end of file diff --git a/Whois/Parsers/ToHostNameTransformer.cs b/Whois/Parsers/ToHostNameTransformer.cs index 8d5bb2df..aec7f7db 100644 --- a/Whois/Parsers/ToHostNameTransformer.cs +++ b/Whois/Parsers/ToHostNameTransformer.cs @@ -1,38 +1,37 @@ using System; using Tokens.Transformers; -namespace Whois.Parsers +namespace Whois.Parsers; + +/// +/// Converts a string into a +/// +public class ToHostNameTransformer : ITokenTransformer { - /// - /// Converts a string into a - public class ToHostNameTransformer : ITokenTransformer + public bool CanTransform(object value, string[] args, out object transformed) { - public bool CanTransform(object value, string[] args, out object transformed) + if (value == null) { - if (value == null) - { - transformed = null; - return true; - } - - var valueString = value.ToString(); - - if (string.IsNullOrEmpty(valueString)) - { - transformed = null; - return true; - } + transformed = null; + return true; + } - if (HostName.TryParse(valueString, out var hostName)) - { - transformed = hostName; - return true; - } + var valueString = value.ToString(); + if (string.IsNullOrEmpty(valueString)) + { transformed = null; + return true; + } - return false; + if (HostName.TryParse(valueString, out var hostName)) + { + transformed = hostName; + return true; } + + transformed = null; + + return false; } -} +} \ No newline at end of file diff --git a/Whois/Parsers/WhoisParser.cs b/Whois/Parsers/WhoisParser.cs index 6debc1db..5997921b 100644 --- a/Whois/Parsers/WhoisParser.cs +++ b/Whois/Parsers/WhoisParser.cs @@ -32,6 +32,7 @@ public WhoisParser() // Register default transformers matcher.RegisterTransformer(); matcher.RegisterTransformer(); + matcher.RegisterTransformer(); // Register default FixUps FixUps.Add(new MultipleContactFixup()); @@ -152,4 +153,5 @@ private void LoadServerGenericTemplates() } } } + } diff --git a/Whois/Resources/whois.nic.mx/mx/Found.txt b/Whois/Resources/whois.nic.mx/mx/Found.txt index 9ee328d3..829716fe 100644 --- a/Whois/Resources/whois.nic.mx/mx/Found.txt +++ b/Whois/Resources/whois.nic.mx/mx/Found.txt @@ -16,12 +16,12 @@ set: Status = Found --- Domain Name: { DomainName : Trim, IsDomainName, ToHostName } -Created On: { Registered ? : Trim, ToDateTimeUtc("dd-MMM-yyyy") } -Expiration Date: { Expiration ? : Trim, ToDateTimeUtc("dd-MMM-yyyy") } -Last Updated On: { Updated ? : Trim, ToDateTimeUtc("dd-MMM-yyyy") } -Created On: { Registered ? : Trim, ToDateTimeUtc("yyyy-MM-dd") } -Expiration Date: { Expiration ? : Trim, ToDateTimeUtc("yyyy-MM-dd") } -Last Updated On: { Updated ? : Trim, ToDateTimeUtc("yyyy-MM-dd") } +Created On: { Registered ? : Trim, SpanishToDecimalMonth, ToDateTimeUtc("dd-MM-yyyy") } +Expiration Date: { Expiration ? : Trim, SpanishToDecimalMonth, ToDateTimeUtc("dd-MM-yyyy") } +Last Updated On: { Updated ? : Trim, SpanishToDecimalMonth, ToDateTimeUtc("dd-MM-yyyy") } +Created On: { Registered ? : Trim, SpanishToDecimalMonth, ToDateTimeUtc("yyyy-MM-dd") } +Expiration Date: { Expiration ? : Trim, SpanishToDecimalMonth, ToDateTimeUtc("yyyy-MM-dd") } +Last Updated On: { Updated ? : Trim, SpanishToDecimalMonth, ToDateTimeUtc("yyyy-MM-dd") } Registrar: { Registrar.Name ? : Trim } URL: { Registrar.Url ? : Trim, IsLooseAbsoluteUrl, ToLower } From 236b553cf08e55fdf238884f8bf6c375f7773e7e Mon Sep 17 00:00:00 2001 From: flipbit Date: Thu, 2 Jun 2022 05:40:47 +0100 Subject: [PATCH 3/6] Add CI Github workflow --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ Whois.sln | 5 +++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..370af2a0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: CI Build + +on: + push: + branches: + - master + paths-ignore: + - '**.md' + + pull_request: + branches: + - master + paths-ignore: + - '**.md' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v1.7.2 + with: + dotnet-version: 6.0.x + + - name: Restore + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Test + run: dotnet test --no-restore diff --git a/Whois.sln b/Whois.sln index 30db20db..cd0d5b7a 100644 --- a/Whois.sln +++ b/Whois.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29009.5 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32519.379 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Whois.Console", "Whois.Console\Whois.Console.csproj", "{611C1679-3605-49A6-902F-DEBFBBC9E0A4}" EndProject @@ -14,6 +14,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2C0D742E-EB77-4FFB-85C5-EFEE3A50DDEE}" ProjectSection(SolutionItems) = preProject appveyor.yml = appveyor.yml + .github\workflows\ci.yml = .github\workflows\ci.yml README.md = README.md EndProjectSection EndProject From c2c263e11dc9b5f831e4da5b4cda3c881ebadb17 Mon Sep 17 00:00:00 2001 From: flipbit Date: Thu, 2 Jun 2022 05:45:10 +0100 Subject: [PATCH 4/6] Fix SampleReader to work on Linux --- Whois.Tests/SampleReader.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Whois.Tests/SampleReader.cs b/Whois.Tests/SampleReader.cs index 30b94d4b..9bb6c3a0 100644 --- a/Whois.Tests/SampleReader.cs +++ b/Whois.Tests/SampleReader.cs @@ -6,7 +6,8 @@ public class SampleReader { public string Read(string whoisServer, string tld, string sampleFileName) { - var directory = Path.Join("..\\..\\..\\Samples", whoisServer, tld); + var sampleDirectory = Path.GetFullPath(Path.Join("..", "..", "..", "Samples")); + var directory = Path.Join(sampleDirectory, whoisServer, tld); var fileName = Path.Join(directory, sampleFileName); return File.ReadAllText(fileName); From d15e9138e766ab479e96514de9e3bc46305b03ae Mon Sep 17 00:00:00 2001 From: flipbit Date: Thu, 2 Jun 2022 05:59:13 +0100 Subject: [PATCH 5/6] Fix unit tests, generate report --- .github/workflows/ci.yml | 8 ++++++-- .../capetown/CapetownParsingTests.cs | 2 -- .../Parsing/whois.afilias-grs.info/bz/BzParsingTests.cs | 2 -- Whois.Tests/Parsing/whois.cctld.uz/uz/UzParsingTests.cs | 1 - Whois.Tests/Parsing/whois.cira.ca/ca/CaParsingTests.cs | 2 -- Whois.Tests/Parsing/whois.co.ug/ug/UgParsingTests.cs | 1 - Whois.Tests/Parsing/whois.dot.cf/cf/CfParsingTests.cs | 1 - .../Parsing/whois.dotname.co.kr/com/ComParsingTests.cs | 1 - .../Parsing/whois.educause.edu/edu/EduParsingTests.cs | 2 -- Whois.Tests/Parsing/whois.eenet.ee/ee/EeParsingTests.cs | 1 - Whois.Tests/Parsing/whois.eu/eu/EuParsingTests.cs | 1 - Whois.Tests/Parsing/whois.iana.org/tld/TldParsingTests.cs | 7 ++++++- Whois.Tests/Parsing/whois.iis.nu/nu/NuParsingTests.cs | 1 - .../Parsing/whois.ja.net/ac.uk/AcUkParsingTests.cs | 1 - Whois.Tests/Parsing/whois.nic.co/co/CoParsingTests.cs | 1 - .../Parsing/whois.nic.coop/coop/CoopParsingTests.cs | 1 - Whois.Tests/Parsing/whois.nic.ec/ex/ExParsingTests.cs | 1 - Whois.Tests/Parsing/whois.nic.gs/gs/GsParsingTests.cs | 1 - Whois.Tests/Parsing/whois.nic.it/it/ItParsingTests.cs | 1 - .../Parsing/whois.nic.priv.at/at/AtParsingTests.cs | 1 - Whois.Tests/Parsing/whois.nic.sh/sh/ShParsingTests.cs | 7 ++++++- Whois.Tests/Parsing/whois.nic.sl/sl/SlParsingTests.cs | 1 - Whois.Tests/Parsing/whois.nic.sn/sn/SnParsingTests.cs | 7 ++++++- Whois.Tests/Parsing/whois.nic.uk/uk/UkParsingTests.cs | 1 - .../Parsing/whois.register.si/si/SiParsingTests.cs | 1 - .../Parsing/whois.registro.br/br/BrParsingTests.cs | 1 - .../Parsing/whois.registry.hm/hm/HmParsingTests.cs | 1 - Whois.Tests/Parsing/whois.sgnic.sg/sg/SgParsingTests.cs | 1 - .../Parsing/whois.thnic.co.th/th/ThParsingTests.cs | 1 - Whois.Tests/Parsing/whois.tld.ee/ee/EeParsingTests.cs | 1 - Whois.Tests/Parsing/whois1.nic.bi/bi/BiParsingTests.cs | 1 - Whois.Tests/Servers/IanaServerLookupTest.cs | 3 --- 32 files changed, 24 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 370af2a0..c58c751c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,10 @@ jobs: - name: Build run: dotnet build --configuration Release --no-restore - + - name: Test - run: dotnet test --no-restore + uses: zyborg/dotnet-tests-report@v1 + with: + project_path: Whois.Tests + report_name: whois_tests + report_title: Whois Tests diff --git a/Whois.Tests/Parsing/capetown-whois.registry.net.za/capetown/CapetownParsingTests.cs b/Whois.Tests/Parsing/capetown-whois.registry.net.za/capetown/CapetownParsingTests.cs index 1ba693ff..b92fdd0d 100644 --- a/Whois.Tests/Parsing/capetown-whois.registry.net.za/capetown/CapetownParsingTests.cs +++ b/Whois.Tests/Parsing/capetown-whois.registry.net.za/capetown/CapetownParsingTests.cs @@ -26,8 +26,6 @@ public void Test_not_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.NotFound, response.Status); Assert.AreEqual("nosuchdomain.capetown", response.DomainName.ToString()); - - AssertWriter.Write(response); } [Test] diff --git a/Whois.Tests/Parsing/whois.afilias-grs.info/bz/BzParsingTests.cs b/Whois.Tests/Parsing/whois.afilias-grs.info/bz/BzParsingTests.cs index 234dfa3b..6197e16d 100644 --- a/Whois.Tests/Parsing/whois.afilias-grs.info/bz/BzParsingTests.cs +++ b/Whois.Tests/Parsing/whois.afilias-grs.info/bz/BzParsingTests.cs @@ -35,8 +35,6 @@ public void Test_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - - AssertWriter.Write(response); } } } diff --git a/Whois.Tests/Parsing/whois.cctld.uz/uz/UzParsingTests.cs b/Whois.Tests/Parsing/whois.cctld.uz/uz/UzParsingTests.cs index 578e2721..6c50fb63 100644 --- a/Whois.Tests/Parsing/whois.cctld.uz/uz/UzParsingTests.cs +++ b/Whois.Tests/Parsing/whois.cctld.uz/uz/UzParsingTests.cs @@ -106,7 +106,6 @@ public void Test_reserved() Assert.AreEqual("RESERVED", response.DomainStatus[0]); Assert.AreEqual(42, response.FieldsParsed); - AssertWriter.Write(response); } [Test] diff --git a/Whois.Tests/Parsing/whois.cira.ca/ca/CaParsingTests.cs b/Whois.Tests/Parsing/whois.cira.ca/ca/CaParsingTests.cs index 3b0a8d08..7e361bec 100644 --- a/Whois.Tests/Parsing/whois.cira.ca/ca/CaParsingTests.cs +++ b/Whois.Tests/Parsing/whois.cira.ca/ca/CaParsingTests.cs @@ -142,8 +142,6 @@ public void Test_not_assigned() Assert.AreEqual("auto-renew grace", response.DomainStatus[0]); Assert.AreEqual(27, response.FieldsParsed); - - AssertWriter.Write(response); } [Test] diff --git a/Whois.Tests/Parsing/whois.co.ug/ug/UgParsingTests.cs b/Whois.Tests/Parsing/whois.co.ug/ug/UgParsingTests.cs index 81ca70be..7e5359f4 100644 --- a/Whois.Tests/Parsing/whois.co.ug/ug/UgParsingTests.cs +++ b/Whois.Tests/Parsing/whois.co.ug/ug/UgParsingTests.cs @@ -70,7 +70,6 @@ public void Test_found() Assert.AreEqual("ACTIVE", response.DomainStatus[0]); Assert.AreEqual(23, response.FieldsParsed); - AssertWriter.Write(response); } [Test] diff --git a/Whois.Tests/Parsing/whois.dot.cf/cf/CfParsingTests.cs b/Whois.Tests/Parsing/whois.dot.cf/cf/CfParsingTests.cs index a3acaa81..741b9b4e 100644 --- a/Whois.Tests/Parsing/whois.dot.cf/cf/CfParsingTests.cs +++ b/Whois.Tests/Parsing/whois.dot.cf/cf/CfParsingTests.cs @@ -132,7 +132,6 @@ public void Test_found_status_registered() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.dot.cf/cf/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.dotname.co.kr/com/ComParsingTests.cs b/Whois.Tests/Parsing/whois.dotname.co.kr/com/ComParsingTests.cs index 75e3604a..a615905b 100644 --- a/Whois.Tests/Parsing/whois.dotname.co.kr/com/ComParsingTests.cs +++ b/Whois.Tests/Parsing/whois.dotname.co.kr/com/ComParsingTests.cs @@ -27,7 +27,6 @@ public void Test_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("generic/tld/Found02", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.educause.edu/edu/EduParsingTests.cs b/Whois.Tests/Parsing/whois.educause.edu/edu/EduParsingTests.cs index 21faa938..356d6e3c 100644 --- a/Whois.Tests/Parsing/whois.educause.edu/edu/EduParsingTests.cs +++ b/Whois.Tests/Parsing/whois.educause.edu/edu/EduParsingTests.cs @@ -343,7 +343,6 @@ public void Test_found_fixture6() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.educause.edu/edu/Found03", response.TemplateName); @@ -972,7 +971,6 @@ public void Test_found_updated_on_unknown() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.educause.edu/edu/Found01", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.eenet.ee/ee/EeParsingTests.cs b/Whois.Tests/Parsing/whois.eenet.ee/ee/EeParsingTests.cs index 756a41e2..e6101a2a 100644 --- a/Whois.Tests/Parsing/whois.eenet.ee/ee/EeParsingTests.cs +++ b/Whois.Tests/Parsing/whois.eenet.ee/ee/EeParsingTests.cs @@ -43,7 +43,6 @@ public void Test_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.eenet.ee/ee/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.eu/eu/EuParsingTests.cs b/Whois.Tests/Parsing/whois.eu/eu/EuParsingTests.cs index 29b6576a..7b49aee4 100644 --- a/Whois.Tests/Parsing/whois.eu/eu/EuParsingTests.cs +++ b/Whois.Tests/Parsing/whois.eu/eu/EuParsingTests.cs @@ -25,7 +25,6 @@ public void Test_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.eu/eu/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.iana.org/tld/TldParsingTests.cs b/Whois.Tests/Parsing/whois.iana.org/tld/TldParsingTests.cs index aff39788..55abd2c1 100644 --- a/Whois.Tests/Parsing/whois.iana.org/tld/TldParsingTests.cs +++ b/Whois.Tests/Parsing/whois.iana.org/tld/TldParsingTests.cs @@ -177,7 +177,12 @@ public void Test_not_assigned() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.NotAssigned, response.Status); - AssertWriter.Write(response); + Assert.AreEqual(0, response.ParsingErrors); + Assert.AreEqual("whois.iana.org/tld/NotAssigned", response.TemplateName); + + Assert.AreEqual("eh", response.DomainName.ToString()); + + Assert.AreEqual(2, response.FieldsParsed); } } } diff --git a/Whois.Tests/Parsing/whois.iis.nu/nu/NuParsingTests.cs b/Whois.Tests/Parsing/whois.iis.nu/nu/NuParsingTests.cs index e12ed0b8..c1862636 100644 --- a/Whois.Tests/Parsing/whois.iis.nu/nu/NuParsingTests.cs +++ b/Whois.Tests/Parsing/whois.iis.nu/nu/NuParsingTests.cs @@ -43,7 +43,6 @@ public void Test_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.iis.nu/nu/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.ja.net/ac.uk/AcUkParsingTests.cs b/Whois.Tests/Parsing/whois.ja.net/ac.uk/AcUkParsingTests.cs index 3faad40d..04504ef7 100644 --- a/Whois.Tests/Parsing/whois.ja.net/ac.uk/AcUkParsingTests.cs +++ b/Whois.Tests/Parsing/whois.ja.net/ac.uk/AcUkParsingTests.cs @@ -26,7 +26,6 @@ public void Test_not_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.NotFound, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.ja.net/NotFound", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.nic.co/co/CoParsingTests.cs b/Whois.Tests/Parsing/whois.nic.co/co/CoParsingTests.cs index 157b2011..9469fbf6 100644 --- a/Whois.Tests/Parsing/whois.nic.co/co/CoParsingTests.cs +++ b/Whois.Tests/Parsing/whois.nic.co/co/CoParsingTests.cs @@ -43,7 +43,6 @@ public void Test_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.nic.co/co/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.nic.coop/coop/CoopParsingTests.cs b/Whois.Tests/Parsing/whois.nic.coop/coop/CoopParsingTests.cs index 352527ea..650af61c 100644 --- a/Whois.Tests/Parsing/whois.nic.coop/coop/CoopParsingTests.cs +++ b/Whois.Tests/Parsing/whois.nic.coop/coop/CoopParsingTests.cs @@ -248,7 +248,6 @@ public void Test_found_status_registered() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.nic.coop/coop/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.nic.ec/ex/ExParsingTests.cs b/Whois.Tests/Parsing/whois.nic.ec/ex/ExParsingTests.cs index f2186e84..d16e87fe 100644 --- a/Whois.Tests/Parsing/whois.nic.ec/ex/ExParsingTests.cs +++ b/Whois.Tests/Parsing/whois.nic.ec/ex/ExParsingTests.cs @@ -43,7 +43,6 @@ public void Test_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.nic.ec/ex/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.nic.gs/gs/GsParsingTests.cs b/Whois.Tests/Parsing/whois.nic.gs/gs/GsParsingTests.cs index eb189a8d..022d01a1 100644 --- a/Whois.Tests/Parsing/whois.nic.gs/gs/GsParsingTests.cs +++ b/Whois.Tests/Parsing/whois.nic.gs/gs/GsParsingTests.cs @@ -26,7 +26,6 @@ public void Test_not_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.NotFound, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.nic.gs/gs/NotFound", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.nic.it/it/ItParsingTests.cs b/Whois.Tests/Parsing/whois.nic.it/it/ItParsingTests.cs index 55b11ffa..7e045fd6 100644 --- a/Whois.Tests/Parsing/whois.nic.it/it/ItParsingTests.cs +++ b/Whois.Tests/Parsing/whois.nic.it/it/ItParsingTests.cs @@ -1433,7 +1433,6 @@ public void Test_found_technical_contact() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.nic.it/it/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.nic.priv.at/at/AtParsingTests.cs b/Whois.Tests/Parsing/whois.nic.priv.at/at/AtParsingTests.cs index 74e4f93a..3905f746 100644 --- a/Whois.Tests/Parsing/whois.nic.priv.at/at/AtParsingTests.cs +++ b/Whois.Tests/Parsing/whois.nic.priv.at/at/AtParsingTests.cs @@ -41,7 +41,6 @@ public void Test_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.nic.priv.at/at/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.nic.sh/sh/ShParsingTests.cs b/Whois.Tests/Parsing/whois.nic.sh/sh/ShParsingTests.cs index 35fdfeb8..be31e933 100644 --- a/Whois.Tests/Parsing/whois.nic.sh/sh/ShParsingTests.cs +++ b/Whois.Tests/Parsing/whois.nic.sh/sh/ShParsingTests.cs @@ -26,7 +26,12 @@ public void Test_not_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.NotFound, response.Status); - AssertWriter.Write(response); + Assert.AreEqual(0, response.ParsingErrors); + Assert.AreEqual("whois.nic.sh/sh/NotFound", response.TemplateName); + + Assert.AreEqual("u34jedzcq.sh", response.DomainName.ToString()); + + Assert.AreEqual(2, response.FieldsParsed); } [Test] diff --git a/Whois.Tests/Parsing/whois.nic.sl/sl/SlParsingTests.cs b/Whois.Tests/Parsing/whois.nic.sl/sl/SlParsingTests.cs index 44f0a720..2767960a 100644 --- a/Whois.Tests/Parsing/whois.nic.sl/sl/SlParsingTests.cs +++ b/Whois.Tests/Parsing/whois.nic.sl/sl/SlParsingTests.cs @@ -42,7 +42,6 @@ public void Test_found() Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.nic.sl/sl/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.nic.sn/sn/SnParsingTests.cs b/Whois.Tests/Parsing/whois.nic.sn/sn/SnParsingTests.cs index 7616a6cb..3fafee04 100644 --- a/Whois.Tests/Parsing/whois.nic.sn/sn/SnParsingTests.cs +++ b/Whois.Tests/Parsing/whois.nic.sn/sn/SnParsingTests.cs @@ -26,7 +26,12 @@ public void Test_not_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.NotFound, response.Status); - AssertWriter.Write(response); + Assert.AreEqual(0, response.ParsingErrors); + Assert.AreEqual("whois.nic.sn/sn/NotFound", response.TemplateName); + + Assert.AreEqual("u34jedzcq.sn", response.DomainName.ToString()); + + Assert.AreEqual(2, response.FieldsParsed); } [Test] diff --git a/Whois.Tests/Parsing/whois.nic.uk/uk/UkParsingTests.cs b/Whois.Tests/Parsing/whois.nic.uk/uk/UkParsingTests.cs index 3df6d1ee..5b1d7524 100644 --- a/Whois.Tests/Parsing/whois.nic.uk/uk/UkParsingTests.cs +++ b/Whois.Tests/Parsing/whois.nic.uk/uk/UkParsingTests.cs @@ -682,7 +682,6 @@ public void Test_suspended_status_suspended() Assert.AreEqual(WhoisStatus.Suspended, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.nic.uk/uk/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.register.si/si/SiParsingTests.cs b/Whois.Tests/Parsing/whois.register.si/si/SiParsingTests.cs index edf817b6..3fae6079 100644 --- a/Whois.Tests/Parsing/whois.register.si/si/SiParsingTests.cs +++ b/Whois.Tests/Parsing/whois.register.si/si/SiParsingTests.cs @@ -41,7 +41,6 @@ public void Test_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.register.si/si/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.registro.br/br/BrParsingTests.cs b/Whois.Tests/Parsing/whois.registro.br/br/BrParsingTests.cs index 27e1c4b1..3c2c3862 100644 --- a/Whois.Tests/Parsing/whois.registro.br/br/BrParsingTests.cs +++ b/Whois.Tests/Parsing/whois.registro.br/br/BrParsingTests.cs @@ -193,7 +193,6 @@ public void Test_found_001hosting() Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.registro.br/br/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.registry.hm/hm/HmParsingTests.cs b/Whois.Tests/Parsing/whois.registry.hm/hm/HmParsingTests.cs index b0f12258..6344098e 100644 --- a/Whois.Tests/Parsing/whois.registry.hm/hm/HmParsingTests.cs +++ b/Whois.Tests/Parsing/whois.registry.hm/hm/HmParsingTests.cs @@ -41,7 +41,6 @@ public void Test_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.registry.hm/hm/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.sgnic.sg/sg/SgParsingTests.cs b/Whois.Tests/Parsing/whois.sgnic.sg/sg/SgParsingTests.cs index 1023647b..d83e5c55 100644 --- a/Whois.Tests/Parsing/whois.sgnic.sg/sg/SgParsingTests.cs +++ b/Whois.Tests/Parsing/whois.sgnic.sg/sg/SgParsingTests.cs @@ -70,7 +70,6 @@ public void Test_found_nameservers_schema_1_with_ip() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.sgnic.sg/sg/Found01", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.thnic.co.th/th/ThParsingTests.cs b/Whois.Tests/Parsing/whois.thnic.co.th/th/ThParsingTests.cs index 0f9cc6c7..8da96687 100644 --- a/Whois.Tests/Parsing/whois.thnic.co.th/th/ThParsingTests.cs +++ b/Whois.Tests/Parsing/whois.thnic.co.th/th/ThParsingTests.cs @@ -43,7 +43,6 @@ public void Test_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.thnic.co.th/th/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois.tld.ee/ee/EeParsingTests.cs b/Whois.Tests/Parsing/whois.tld.ee/ee/EeParsingTests.cs index e2b5be8a..2e6b0299 100644 --- a/Whois.Tests/Parsing/whois.tld.ee/ee/EeParsingTests.cs +++ b/Whois.Tests/Parsing/whois.tld.ee/ee/EeParsingTests.cs @@ -139,7 +139,6 @@ public void Test_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.Found, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("whois.tld.ee/ee/Found", response.TemplateName); diff --git a/Whois.Tests/Parsing/whois1.nic.bi/bi/BiParsingTests.cs b/Whois.Tests/Parsing/whois1.nic.bi/bi/BiParsingTests.cs index 2a033306..32ba9426 100644 --- a/Whois.Tests/Parsing/whois1.nic.bi/bi/BiParsingTests.cs +++ b/Whois.Tests/Parsing/whois1.nic.bi/bi/BiParsingTests.cs @@ -26,7 +26,6 @@ public void Test_not_found() Assert.Greater(sample.Length, 0); Assert.AreEqual(WhoisStatus.NotFound, response.Status); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("generic/tld/NotFound004", response.TemplateName); diff --git a/Whois.Tests/Servers/IanaServerLookupTest.cs b/Whois.Tests/Servers/IanaServerLookupTest.cs index 804ee192..29e5c76a 100644 --- a/Whois.Tests/Servers/IanaServerLookupTest.cs +++ b/Whois.Tests/Servers/IanaServerLookupTest.cs @@ -104,7 +104,6 @@ public void TestLookupBe() var response = lookup.Lookup(new WhoisRequest("test.be")); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("be", response.DomainName.ToString()); @@ -176,12 +175,10 @@ public void TestLookupNotFound() var response = lookup.Lookup(new WhoisRequest("test.be")); - AssertWriter.Write(response); Assert.AreEqual(0, response.ParsingErrors); Assert.AreEqual("eh", response.DomainName.ToString()); - Assert.AreEqual(0, response.FieldsParsed); } } From d4c2bb6e07601df2f03493ad333e804e6c4181b2 Mon Sep 17 00:00:00 2001 From: flipbit Date: Thu, 2 Jun 2022 06:07:33 +0100 Subject: [PATCH 6/6] Add github token --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c58c751c..98d8fef9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,3 +38,4 @@ jobs: project_path: Whois.Tests report_name: whois_tests report_title: Whois Tests + github_token: ${{ secrets.GITHUB_TOKEN }}