Example in C#

The following is an example of a MockDateTimeService in C#. The MockDateTimeService allows you to set the DateTime to be returned by the service in order to reliably test how other parts of the system might behave based on specific DateTime.

class MockDateTimeService
{
public DateTime CurrentDateTime { get; set; } = new DateTime();

public DateTime UTCNow()
{
return CurrentDateTime.ToUniversalTime();
}
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.69.106