예제 #1
0
        public void TestSerializeRecord()
        {
            var file = new FileListItem("my/path", new DateTimeOffset(2020, 05, 04, 10, 2, 0, 0, TimeSpan.Zero), 500);

            file.ToJson(JsonExtensions.DefaultSettings(Formatting.None)).Should().Be("{\"path\":\"my/path\",\"modified\":\"2020-05-04T10:02:00+00:00\",\"bytes\":500}");
            file.ToJson().ToObject <FileListItem>().Should().BeEquivalentTo(file);
        }
예제 #2
0
    public void TestSerializeRecord()
    {
        var file = new FileListItem("my/path", new DateTimeOffset(year: 2020, month: 05, day: 04, hour: 10, minute: 2, second: 0, millisecond: 0, TimeSpan.Zero),
                                    Bytes: 500);

        file.ToJson(JsonExtensions.DefaultSettings(Formatting.None)).Should()
        .Be("{\"path\":\"my/path\",\"modified\":\"2020-05-04T10:02:00+00:00\",\"bytes\":500}");
        file.ToJson().ToObject <FileListItem>().Should().BeEquivalentTo(file);
    }