public void ToWorkExtensionsClass_ToYamlToWorkModelMethod_ReturnsObjectWithCorrectTextProperty_IfParameterHasTextPropertyThatIsNotNull() { ToWork testParam = GetTestObject(); ToWorkModel testOutput = testParam.ToYamlToWorkModel(); Assert.AreEqual(testParam.Text, testOutput.Text); }
public void ToWorkExtensionsClass_ToYamlToWorkModelMethod_ThrowsNullReferenceException_IfParameterIsNull() { ToWork testParam = null; _ = testParam.ToYamlToWorkModel(); Assert.Fail(); }
public void ToWorkExtensionsClass_ToYamlToWorkModelMethod_ReturnsObjectWithAtPropertyEqualToNull_IfParameterHasAtTimePropertyThatIsNotNull() { ToWork testParam = GetTestObject(); testParam.AtTime = null; ToWorkModel testOutput = testParam.ToYamlToWorkModel(); Assert.IsNull(testOutput.At); }
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); }