예제 #1
0
 public void XamlServicesSave_ShouldSerialiseToISO8601_GivenDateEndingWithZero()
 {
     var testData = new TestDateTimeDto { Created = new DateTime(2015, 12, 30) };
     var result = XamlServices.Save(testData);
     Console.WriteLine(result);
     Assert.IsTrue(result.Contains("2015-12-30"));
 }
예제 #2
0
 public void XamlServicesSave_ShouldSerialiseToISO8601_GivenUtcDateTime()
 {
     var testData = new TestDateTimeDto { Created = new DateTime(2015, 12, 30, 23, 50, 51, DateTimeKind.Utc) };
     var result = XamlServices.Save(testData);
     Console.WriteLine(result);
     Assert.IsTrue(result.Contains("2015-12-30T23:50:51Z"));
 }
예제 #3
0
        public void XamlServicesSave_ShouldSerialiseToISO8601_GivenDateEndingWithZero()
        {
            var testData = new TestDateTimeDto {
                Created = new DateTime(2015, 12, 30)
            };
            var result = XamlServices.Save(testData);

            Console.WriteLine(result);
            Assert.IsTrue(result.Contains("2015-12-30"));
        }
예제 #4
0
        public void XamlServicesSave_ShouldSerialiseToISO8601_GivenUtcDateTime()
        {
            var testData = new TestDateTimeDto {
                Created = new DateTime(2015, 12, 30, 23, 50, 51, DateTimeKind.Utc)
            };
            var result = XamlServices.Save(testData);

            Console.WriteLine(result);
            Assert.IsTrue(result.Contains("2015-12-30T23:50:51Z"));
        }
예제 #5
0
 public void XamlServicesSave_ShouldSerialiseToISO8601_GivenLocalisedDateTimeWithMilliseconds()
 {
     var usTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
     var localisedDateTime = TimeZoneInfo.ConvertTimeFromUtc(
         new DateTime(2015, 12, 30, 23, 50, 51, DateTimeKind.Utc),
         usTimeZone);
     var testData = new TestDateTimeDto { Created = localisedDateTime };
     testData.Created = testData.Created.AddMilliseconds(11);
     var result = XamlServices.Save(testData);
     Console.WriteLine(result);
     Assert.IsTrue(result.Contains("2015-12-30T15:50:51.011"));
 }
예제 #6
0
        public void XamlServicesSave_ShouldSerialiseToISO8601_GivenLocalisedDateTimeWithMilliseconds()
        {
            var usTimeZone        = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
            var localisedDateTime = TimeZoneInfo.ConvertTimeFromUtc(
                new DateTime(2015, 12, 30, 23, 50, 51, DateTimeKind.Utc),
                usTimeZone);
            var testData = new TestDateTimeDto {
                Created = localisedDateTime
            };

            testData.Created = testData.Created.AddMilliseconds(11);
            var result = XamlServices.Save(testData);

            Console.WriteLine(result);
            Assert.IsTrue(result.Contains("2015-12-30T15:50:51.011"));
        }