public void TestParsingDateFromConstructorLikeString_Negative() { DateConstuctorStrategy strategy = new DateConstuctorStrategy(); string inputString = "/Date(1612534319000)/"; DateTime?actualDate = strategy.ConverDate(inputString); Assert.IsFalse(actualDate.HasValue); }
public void TestParsingDateFromConstructorLikeString() { DateConstuctorStrategy strategy = new DateConstuctorStrategy(); string inputString = "/Date(2019,11,5,17,7,26,0)/"; DateTime expectedDate = new DateTime(2019, 11, 5, 17, 7, 26, 0); DateTime?actualDate = strategy.ConverDate(inputString); Assert.AreEqual(expectedDate, actualDate); }