Exemple #1
0
        public void Test_TryParseDateTime_InvalidFormat(string jsonData)
        {
            DateTime value;
            bool     res = JsonValueParser.TryParseDateTime(jsonData, out value);

            Assert.That(res, Is.False);
        }
Exemple #2
0
        public void Test_TryParseDateTime_Valid(string jsonData, string expectedData)
        {
            DateTime value;
            DateTime expected = DateTime.Parse(expectedData, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal);
            bool     res      = JsonValueParser.TryParseDateTime(jsonData, out value);

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