public void Parse_ValueIsValidDateTime_ReturnsParsedValue(Tuple <string, DateTimeOffset> testPair) { var testValue = testPair.Item1; var result = DateTimeOffsetHelper.Parse(testValue); var expectedResult = testPair.Item2; Assert.That(result, Is.EqualTo(expectedResult)); }
public void Parse_ValueIsNotValid_Throws(string unsupportedDateTimeOffset) { TestDelegate testDelegate = () => DateTimeOffsetHelper.Parse(unsupportedDateTimeOffset); Assert.That(testDelegate, Throws.TypeOf <CrossSectionSurveyDataFormatException>().With.Message.Contains("not in the expected DateTime format")); }