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

Version 4.0 #92

Open
wants to merge 7 commits 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
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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/[email protected]
with:
dotnet-version: 6.0.x

- name: Restore
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Test
uses: zyborg/dotnet-tests-report@v1
with:
project_path: Whois.Tests
report_name: whois_tests
report_title: Whois Tests
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion 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 Down
2 changes: 1 addition & 1 deletion Whois.Tests.Integration/Whois.Tests.Integration.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Whois</RootNamespace>
<ApplicationIcon />
<OutputType>Library</OutputType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public void Test_found()

Assert.Greater(sample.Length, 0);
Assert.AreEqual(WhoisStatus.Found, response.Status);

AssertWriter.Write(response);
}
}
}
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.cctld.uz/uz/UzParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public void Test_reserved()
Assert.AreEqual("RESERVED", response.DomainStatus[0]);

Assert.AreEqual(42, response.FieldsParsed);
AssertWriter.Write(response);
}

[Test]
Expand Down
2 changes: 0 additions & 2 deletions Whois.Tests/Parsing/whois.cira.ca/ca/CaParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.co.ug/ug/UgParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public void Test_found()
Assert.AreEqual("ACTIVE", response.DomainStatus[0]);

Assert.AreEqual(23, response.FieldsParsed);
AssertWriter.Write(response);
}

[Test]
Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.dot.cf/cf/CfParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 0 additions & 2 deletions Whois.Tests/Parsing/whois.educause.edu/edu/EduParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.eenet.ee/ee/EeParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.eu/eu/EuParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
7 changes: 6 additions & 1 deletion Whois.Tests/Parsing/whois.iana.org/tld/TldParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.iis.nu/nu/NuParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.ja.net/ac.uk/AcUkParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.nic.co/co/CoParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.nic.ec/ex/ExParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.nic.gs/gs/GsParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.nic.it/it/ItParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.nic.mx/mx/MxParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.nic.priv.at/at/AtParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
7 changes: 6 additions & 1 deletion Whois.Tests/Parsing/whois.nic.sh/sh/ShParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.nic.sl/sl/SlParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
7 changes: 6 additions & 1 deletion Whois.Tests/Parsing/whois.nic.sn/sn/SnParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.nic.uk/uk/UkParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.register.si/si/SiParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.registro.br/br/BrParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.registry.hm/hm/HmParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.sgnic.sg/sg/SgParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.thnic.co.th/th/ThParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois.tld.ee/ee/EeParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Whois.Tests/Parsing/whois1.nic.bi/bi/BiParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion Whois.Tests/SampleReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions Whois.Tests/Servers/IanaServerLookupTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Whois.Tests/Whois.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Whois</RootNamespace>
<ApplicationIcon />
<OutputType>Library</OutputType>
Expand Down
5 changes: 3 additions & 2 deletions Whois.sln
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
Loading