Beispiel #1
0
        public void Test_TryParseDate_InvalidFormat(string jsonData)
        {
            DateTime value;
            bool     res = JsonValueParser.TryParseDate(jsonData, out value);

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

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