Skip to content

Commit

Permalink
add more test code
Browse files Browse the repository at this point in the history
  • Loading branch information
tinohager committed Feb 20, 2024
1 parent 765d367 commit 1281950
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Nager.PublicSuffix.TestConsole/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,18 @@
Console.WriteLine($"{"RegistrableDomain:", 20} {domainInfo.RegistrableDomain}");
Console.WriteLine($"{"Subdomain:",20} {domainInfo.Subdomain}");
Console.WriteLine("------------------------------------------------");
}
}


var validDomains = new[] { "www.google.com", "amazon.com", "microsoft.de", "mail.google.com" };
var invalidDomains = new[] { "www", "uk", "co.uk", ".", "[email protected]" };

foreach (var validDomain in validDomains)
{
Console.WriteLine($"{validDomain} -> {domainParser.IsValidDomain(validDomain)}");
}

foreach (var invalidDomain in invalidDomains)
{
Console.WriteLine($"{invalidDomain} -> {domainParser.IsValidDomain(invalidDomain)}");
}

0 comments on commit 1281950

Please sign in to comment.