public void Test_TryParseDate_InvalidFormat(string jsonData) { DateTime value; bool res = JsonValueParser.TryParseDate(jsonData, out value); Assert.That(res, Is.False); }
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)); }