Skip to content

Instantly share code, notes, and snippets.

@OksanaH

OksanaH/Tests.cs Secret

Created May 27, 2021
Embed
What would you like to do?
Tests.cs
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