-
-
Save OksanaH/81cd28e1e029d5604bd05a1b6755570d to your computer and use it in GitHub Desktop.
Tests.cs
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 UnitTests | |
{ | |
[Fact] | |
public void DateInPast_ReturnsCorrectResult() | |
{ | |
var controller = new HomeController(); | |
var date = new DateTime(1983, 2, 3); | |
var expected = $"{String.Format("{0:d}", date)} was Thursday"; | |
var actual = controller.Get(date) as OkObjectResult; | |
Assert.Equal(expected, actual.Value); | |
} | |
[Fact] | |
public void DateInFuture_ReturnsCorrectResult() | |
{ | |
var controller = new HomeController(); | |
var date = new DateTime(2033, 12, 9); | |
var expected = $"{String.Format("{0:d}", date)} will be Friday"; | |
var actual = controller.Get(date) as OkObjectResult; | |
Assert.Equal(expected, actual.Value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment