public void SignalboxHoursModelExtensionsClass_ToSignalboxHoursMethod_ReturnsObjectWithSignalboxPropertySetToNull_IfSecondParameterIsCollectionThatDoesNotContainSignalboxIdPropertyOfFirstParameter() { SignalboxHoursModel testParam0 = GetTestObject(); IDictionary <string, Signalbox> testParam1 = GetSignalboxCollectionWithoutItem(testParam0.SignalboxId); SignalboxHours testOutput = testParam0.ToSignalboxHours(testParam1); Assert.IsNull(testOutput.Signalbox); }
public void SignalboxHoursModelExtensionsClass_ToSignalboxHoursMethod_ThrowsArgumentNullException_IfSecondParameterIsNull() { SignalboxHoursModel testObject = new SignalboxHoursModel(); IDictionary <string, Signalbox> testParam1 = null; _ = testObject.ToSignalboxHours(testParam1); Assert.Fail(); }
public void SignalboxHoursModelExtensionsClass_ToSignalboxHoursMethod_ThrowsNullReferenceException_IfFirstParameterIsNull() { SignalboxHoursModel testParam0 = null; IDictionary <string, Signalbox> testParam1 = new Dictionary <string, Signalbox>(); _ = testParam0.ToSignalboxHours(testParam1); Assert.Fail(); }
public void SignalboxHoursModelExtensionsClass_ToSignalboxHoursMethod_ReturnsObjectWithSignalboxPropertySetToNull_IfSecondParameterIsEmptyCollection() { SignalboxHoursModel testParam0 = GetTestObject(); IDictionary <string, Signalbox> testParam1 = new Dictionary <string, Signalbox>(); SignalboxHours testOutput = testParam0.ToSignalboxHours(testParam1); Assert.IsNull(testOutput.Signalbox); }
public void SignalboxHoursModelExtensionsClass_ToSignalboxHoursMethod_ReturnsObjectWithCorrectSignalboxProperty_IfSecondParameterIsCollectionThatContainsSignalboxIdPropertyOfFirstParameter() { SignalboxHoursModel testParam0 = GetTestObject(); IDictionary <string, Signalbox> testParam1 = GetSignalboxCollectionWithItem(testParam0.SignalboxId); SignalboxHours testOutput = testParam0.ToSignalboxHours(testParam1); Assert.AreSame(testParam1[testParam0.SignalboxId], testOutput.Signalbox); }
public void SignalboxHoursModelExtensionsClass_ToSignalboxHoursMethod_ReturnsObjectWithTokenBalanceWarningPropertyFalse_IfFirstParameterHasTokenBalanceWarningPropertyThatIsTrue() { SignalboxHoursModel testParam0 = GetTestObject(); testParam0.TokenBalanceWarning = true; IDictionary <string, Signalbox> testParam1 = GetSignalboxCollectionWithItem(testParam0.SignalboxId); SignalboxHours testOutput = testParam0.ToSignalboxHours(testParam1); Assert.IsTrue(testOutput.TokenBalanceWarning); }
public void SignalboxHoursModelExtensionsClass_ToSignalboxHoursMethod_ThrowsFormatException_IfFirstParameterHasFinishTimePropertyThatHasTimePropertyThatConsistsOfNonNumericString() { SignalboxHoursModel testParam0 = GetTestObject(); testParam0.FinishTime = new TimeOfDaySpecification(TimeOfDaySpecification.TimeOfDaySpecificationKind.NonNumericValue).Model; IDictionary <string, Signalbox> testParam1 = GetSignalboxCollectionWithItem(testParam0.SignalboxId); _ = testParam0.ToSignalboxHours(testParam1); Assert.Fail(); }
public void SignalboxHoursModelExtensionsClass_ToSignalboxHoursMethod_ThrowsNullReferenceException_IfParameterHasFinishTimePropertyThatIsNull() { SignalboxHoursModel testParam0 = GetTestObject(); testParam0.FinishTime = null; IDictionary <string, Signalbox> testParam1 = GetSignalboxCollectionWithItem(testParam0.SignalboxId); _ = testParam0.ToSignalboxHours(testParam1); Assert.Fail(); }
public void SignalboxHoursModelExtensionsClass_ToSignalboxHoursMethod_ThrowsFormatException_IfFirstParameterHasStartTimePropertyThatHasTimePropertyThatIsSolelyWhitespace() { SignalboxHoursModel testParam0 = GetTestObject(); testParam0.StartTime = new TimeOfDaySpecification(TimeOfDaySpecification.TimeOfDaySpecificationKind.WhitespaceValue).Model; IDictionary <string, Signalbox> testParam1 = GetSignalboxCollectionWithItem(testParam0.SignalboxId); _ = testParam0.ToSignalboxHours(testParam1); Assert.Fail(); }
public void SignalboxHoursModelExtensionsClass_ToSignalboxHoursMethod_ReturnsObjectWithEndTimePropertyWithCorrectValue_IfFirstParameterHasFinishTimePropertyThatHasTimePropertyThatConsistsOfMoreThanThreeNumbersInRangeSeparatedByColons() { SignalboxHoursModel testParam0 = GetTestObject(); TimeOfDaySpecification finishTimeSpecification = new TimeOfDaySpecification(TimeOfDaySpecification.TimeOfDaySpecificationKind.HoursMinutesSecondsAndMore); testParam0.FinishTime = finishTimeSpecification.Model; IDictionary <string, Signalbox> testParam1 = GetSignalboxCollectionWithItem(testParam0.SignalboxId); SignalboxHours testOutput = testParam0.ToSignalboxHours(testParam1); Assert.AreEqual(finishTimeSpecification.Hours.Value, testOutput.EndTime.Hours24); Assert.AreEqual(finishTimeSpecification.Minutes.Value, testOutput.EndTime.Minutes); Assert.AreEqual(finishTimeSpecification.Seconds.Value, testOutput.EndTime.Seconds); }
public void SignalboxHoursModelExtensionsClass_ToSignalboxHoursMethod_ReturnsObjectWithStartTimePropertyWithCorrectValue_IfFirstParameterHasStartTimePropertyThatHasTimePropertyThatConsistsOfNumberInRangeWithNoColons() { SignalboxHoursModel testParam0 = GetTestObject(); TimeOfDaySpecification startTimeSpecification = new TimeOfDaySpecification(TimeOfDaySpecification.TimeOfDaySpecificationKind.HoursOnly); testParam0.StartTime = startTimeSpecification.Model; IDictionary <string, Signalbox> testParam1 = GetSignalboxCollectionWithItem(testParam0.SignalboxId); SignalboxHours testOutput = testParam0.ToSignalboxHours(testParam1); Assert.AreEqual(startTimeSpecification.Hours.Value, testOutput.StartTime.Hours24); Assert.AreEqual(0, testOutput.StartTime.Minutes); Assert.AreEqual(0, testOutput.StartTime.Seconds); }
public void SignalboxHoursModelExtensionsClass_ToSignalboxHoursMethod_ThrowsArgumentNullExceptionWithCorrectParamNameProperty_IfSecondParameterIsNull() { SignalboxHoursModel testObject = new SignalboxHoursModel(); IDictionary <string, Signalbox> testParam1 = null; try { _ = testObject.ToSignalboxHours(testParam1); Assert.Fail(); } catch (ArgumentNullException ex) { Assert.AreEqual("signalboxes", ex.ParamName); } }