public void ParseShouldReturnOptionDateTimeNone() { // Arrange var s = "not a date and time"; Option <DateTime> expected = None; // Act var result = DateTimeType.Parse(s); // Assert result.Should().Be(expected); }
public void ParseShouldReturnOptionDateTimeSome() { // Arrange var dateTime = DateTime.Now; var s = dateTime.ToString("o", CultureInfo.CurrentCulture); Option <DateTime> expected = Some(dateTime); // Act var result = DateTimeType.Parse(s); // Assert result.Should().Be(expected); }
public void ParseWithFormatProviderShouldReturnOptionDateTimeSome() { // Arrange var dateTime = DateTime.Now; IFormatProvider formatProvider = CultureInfo.CreateSpecificCulture("de-DE"); var s = dateTime.ToString("o", formatProvider); Option <DateTime> expected = Some(dateTime); // Act var result = DateTimeType.Parse(s, formatProvider); // Assert result.Should().Be(expected); }