Esempio n. 1
0
        public void Test_TryParseTime_InvalidFormat(string jsonData)
        {
            DateTime value;
            bool     res = JsonValueParser.TryParseTime(jsonData, out value);

            Assert.That(res, Is.False);
        }
Esempio n. 2
0
        public void Test_TryParseTime_Valid(string jsonData, string expectedData)
        {
            DateTime value;
            DateTime expected = DateTime.Parse(expectedData, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal);
            bool     res      = JsonValueParser.TryParseTime(jsonData, out value);

            Assert.That(res, Is.True);
            Assert.That(value, Is.EqualTo(expected));
        }