Beispiel #1
0
        public void TrainTimeExtensionsClass_ToYamlTrainTimeModelMethod_ReturnsObjectWithFootnoteIdsPropertyOfCorrectLength_WhenParameterIsNotNull()
        {
            TrainTime testParam = GetTestObject();

            TrainTimeModel testOutput = testParam.ToYamlTrainTimeModel();

            Assert.AreEqual(testParam.Footnotes.Count, testOutput.FootnoteIds.Count);
        }
Beispiel #2
0
        public void TrainTimeExtensionsClass_ToYamlTrainTimeModelMethod_ThrowsNullReferenceException_WhenParameterIsNull()
        {
            TrainTime testParam = null;

            _ = testParam.ToYamlTrainTimeModel();

            Assert.Fail();
        }
Beispiel #3
0
        public void TrainTimeExtensionsClass_ToYamlTrainTimeModelMethod_ReturnsObjectWithAtPropertyThatIsNull_WhenParameterHasTimePropertyThatIsNull()
        {
            TrainTime testParam = GetTestObject();

            testParam.Time = null;

            TrainTimeModel testOutput = testParam.ToYamlTrainTimeModel();

            Assert.IsNull(testOutput.At);
        }
Beispiel #4
0
        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]);
            }
        }
Beispiel #5
0
        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);
        }