public void GetTimestamp_Local_Test() { var now = new DateTime(2000, 1, 2, 3, 4, 5, 6, DateTimeKind.Local); var provider = CreateIsolatedTimestampProvider(now); var policy = new TimestampPolicy { TimeZone = "Local" }; string actual = provider.GetTimestamp(policy); string expected = $"[{now.ToString(policy.Format)}]"; Assert.Equal(expected, actual); }
public void GetTimestamp_InlineData_Test(string format, string timezone, string expected) { var now = new DateTime(2000, 1, 2, 3, 4, 5, 6, DateTimeKind.Utc); var provider = CreateIsolatedTimestampProvider(now); var policy = new TimestampPolicy { Format = format, TimeZone = timezone }; string actual = provider.GetTimestamp(policy); Assert.Equal(expected, actual); }