Exemplo n.º 1
0
        public void ToWorkExtensionsClass_ToYamlToWorkModelMethod_ReturnsObjectWithCorrectTextProperty_IfParameterHasTextPropertyThatIsNotNull()
        {
            ToWork testParam = GetTestObject();

            ToWorkModel testOutput = testParam.ToYamlToWorkModel();

            Assert.AreEqual(testParam.Text, testOutput.Text);
        }
Exemplo n.º 2
0
        public void ToWorkExtensionsClass_ToYamlToWorkModelMethod_ThrowsNullReferenceException_IfParameterIsNull()
        {
            ToWork testParam = null;

            _ = testParam.ToYamlToWorkModel();

            Assert.Fail();
        }
Exemplo n.º 3
0
        public void ToWorkExtensionsClass_ToYamlToWorkModelMethod_ReturnsObjectWithAtPropertyEqualToNull_IfParameterHasAtTimePropertyThatIsNotNull()
        {
            ToWork testParam = GetTestObject();

            testParam.AtTime = null;

            ToWorkModel testOutput = testParam.ToYamlToWorkModel();

            Assert.IsNull(testOutput.At);
        }
Exemplo n.º 4
0
        public void ToWorkExtensionsClass_ToYamlToWorkModelMethod_ReturnsObjectWithAtPropertyWithCorrectTimeProperty_IfParameterHasAtTimePropertyThatIsNotNull()
        {
            ToWork testParam = GetTestObject();

            ToWorkModel testOutput = testParam.ToYamlToWorkModel();

            string expectedValue = testParam.AtTime.Hours24.ToString("d2", CultureInfo.InvariantCulture) + ":" +
                                   testParam.AtTime.Minutes.ToString("d2", CultureInfo.InvariantCulture) + ":" +
                                   testParam.AtTime.Seconds.ToString("d2", CultureInfo.InvariantCulture);

            Assert.AreEqual(expectedValue, testOutput.At.Time);
        }