Namespace: DeltaEngine.Extensions
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Tests.Extensions.DateExtensionsTests
4 unit tests call DeltaEngine.Extensions.DateExtensions.Parse(System.String)
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- dateString
- Type: System String
Return Value
Type: DateTimeRemarks
Examples
[Test] public void EmptyStringJustReturnsTheSmallestDate() { Assert.AreEqual(DateTime.MinValue, DateExtensions.Parse("")); }
[Test] public void IncorrectDateStringWillReturnCurrentDateTime() { AssertDateTime(DateTime.Now, DateExtensions.Parse("2013[08]17")); AssertDateTime(DateTime.Now, DateExtensions.Parse("2013[08]17 00")); }
[Test] public void ParsePureIsoDate() { var expectedDate = new DateTime(2013, 8, 21); Assert.AreEqual(expectedDate, DateExtensions.Parse(2013 + "-" + 8 + "-" + 21)); }
See Also