Dotnet, Development, C Sharp Programming, Csharp, Microsoft.
public void GetTimeOfDay_ShouldReturnMorning_WhenItIsMorning() { // Arrange var fakeTimeProvider = new FakeTimeProvider(); fakeTimeProvider.SetUtcNow(new DateTime(2024, 1, 1, 8, 0, 0)); var demoService = new DemoService(fakeTimeProvider); // Act var result = demoService.GetTimeOfDay(); // Assert