public void Execute_TextToDateTimeWithCulture_Valid(string value, string format, string culture, DateTime expected) { var function = new TextToDateTime(new LiteralScalarResolver <string>(format), new LiteralScalarResolver <string>(culture)); var result = function.Evaluate(value); Assert.That(result, Is.EqualTo(expected)); }
public void Execute_TextToDateTime_Valid(string value, string format, DateTime expected) { var function = new TextToDateTime(new LiteralScalarResolver <string>(format)); var result = function.Evaluate(value); Assert.That(result, Is.EqualTo(expected)); Assert.That(((DateTime)result).Kind, Is.EqualTo(DateTimeKind.Unspecified)); }
public void Execute_TextToDateTimeAndUtcToLocal_Valid(string value, string format, string timeZone, DateTime expected) { var textToDateTime = new TextToDateTime(new LiteralScalarResolver <string>(format)); var utcToLocal = new UtcToLocal(new LiteralScalarResolver <string>(timeZone)); var result = utcToLocal.Evaluate(textToDateTime.Evaluate(value)); Assert.That(result, Is.EqualTo(expected)); Assert.That(((DateTime)result).Kind, Is.EqualTo(DateTimeKind.Unspecified)); }