Ejemplo n.º 1
0
        static void AssertParseSuccess(DateTimeOffset expected, string text)
        {
            var parsed = Timestamps.Parse(text);

            AssertTimestampsEqual(expected, parsed);

            Assert.True(Timestamps.TryParse(text, out parsed));
            AssertTimestampsEqual(expected, parsed);
        }
Ejemplo n.º 2
0
 [InlineData("2021-01-01T00:01Z")]              // No second part
 public void Parse_Failure(string text)
 {
     Assert.False(Timestamps.TryParse(text, out _));
     Assert.Throws <FormatException>(() => Timestamps.Parse(text));
 }