DateExtensions Parse Method Delta Engine Documentation

Namespace: DeltaEngine.Extensions
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public static DateTime Parse(
	string dateString
)

Return Value

Type: DateTime
Remarks

Tests: DeltaEngine.Tests.Extensions.DateExtensionsTests
Examples

4 unit tests call DeltaEngine.Extensions.DateExtensions.Parse(System.String)
[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