public void TrainTimeExtensionsClass_ToYamlTrainTimeModelMethod_ReturnsObjectWithFootnoteIdsPropertyOfCorrectLength_WhenParameterIsNotNull() { TrainTime testParam = GetTestObject(); TrainTimeModel testOutput = testParam.ToYamlTrainTimeModel(); Assert.AreEqual(testParam.Footnotes.Count, testOutput.FootnoteIds.Count); }
public void TrainTimeExtensionsClass_ToYamlTrainTimeModelMethod_ThrowsNullReferenceException_WhenParameterIsNull() { TrainTime testParam = null; _ = testParam.ToYamlTrainTimeModel(); Assert.Fail(); }
public void TrainTimeExtensionsClass_ToYamlTrainTimeModelMethod_ReturnsObjectWithAtPropertyThatIsNull_WhenParameterHasTimePropertyThatIsNull() { TrainTime testParam = GetTestObject(); testParam.Time = null; TrainTimeModel testOutput = testParam.ToYamlTrainTimeModel(); Assert.IsNull(testOutput.At); }
public void TrainTimeExtensionsClass_ToYamlTrainTimeModelMethod_ReturnsObjectWithFootnoteIdsPropertyContainingCorrectValues_WhenParameterIsNotNull() { TrainTime testParam = GetTestObject(); TrainTimeModel testOutput = testParam.ToYamlTrainTimeModel(); for (int i = 0; i < testParam.Footnotes.Count; ++i) { Assert.AreEqual(testParam.Footnotes[i].Id, testOutput.FootnoteIds[i]); } }
public void TrainTimeExtensionsClass_ToYamlTrainTimeModelMethod_ReturnsObjectWithAtPropertyWithCorrectTimeProperty_WhenParameterHasTimePropertyThatIsNotNull() { TrainTime testParam = GetTestObject(); TrainTimeModel testOutput = testParam.ToYamlTrainTimeModel(); string expectedValue = testParam.Time.Hours24.ToString("d2", CultureInfo.InvariantCulture) + ":" + testParam.Time.Minutes.ToString("d2", CultureInfo.InvariantCulture) + ":" + testParam.Time.Seconds.ToString("d2", CultureInfo.InvariantCulture); Assert.AreEqual(expectedValue, testOutput.At.Time); }