Esempio n. 1
0
        public void MetadataDateTime_ToString_ProducesCorrectResult()
        {
            var dateTimeOffsetNow = DateTimeOffset.Now;
            var metadataDateTime  = new MetadataDateTime(dateTimeOffsetNow, Date);

            var expectedToStringResult = dateTimeOffsetNow.ToString() + " {" + metadataDateTime.Flags.ToString() + "}";
            var actualToStringResult   = metadataDateTime.ToString();

            Assert.Equal(expectedToStringResult, actualToStringResult);
        }
Esempio n. 2
0
        public void MetadataDateTime_ToStringWithFormatPovider_ProducesCorrectResult()
        {
            var formatProvider    = CultureInfo.GetCultureInfo("de-DE");
            var dateTimeOffsetNow = DateTimeOffset.Now;
            var metadataDateTime  = new MetadataDateTime(dateTimeOffsetNow, Date);

            var expectedToStringResult = dateTimeOffsetNow.ToString(formatProvider) + " {" + metadataDateTime.Flags.ToString() + "}";
            var actualToStringResult   = metadataDateTime.ToString(formatProvider);

            Assert.Equal(expectedToStringResult, actualToStringResult);
        }