-
-
Save dcomartin/d6fc5c612f0df8108cfbeb4b2acec98b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AgeVerificationTest | |
{ | |
private readonly AgeVerification _obj = new(); | |
[Fact] | |
public void NotOver18() | |
{ | |
var result = _obj.Is18YearsOrOlder(new DateTime(2006, 10, 22)); | |
result.ShouldBe(false); | |
} | |
[Fact] | |
public void Over18() | |
{ | |
var result = _obj.Is18YearsOrOlder(new DateTime(2006, 10, 20)); | |
result.ShouldBe(true); | |
} | |
[Fact] | |
public void NotOver18_2() | |
{ | |
var result = _obj.Is18YearsOrOlder(DateTime.UtcNow.AddYears(-18).AddDays(1)); | |
result.ShouldBe(false); | |
} | |
[Fact] | |
public void Over18_2() | |
{ | |
var result = _obj.Is18YearsOrOlder(DateTime.UtcNow.AddYears(-18).AddDays(-1)); | |
result.ShouldBe(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment