Exemplo n.º 1
0
        public void TrainTimeClassCopyMethodReturnsDifferentObject()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();

            TrainTime testOutput = testObject.Copy();

            Assert.AreNotSame(testObject, testOutput);
        }
Exemplo n.º 2
0
        public void TrainTimeClassCopyMethodReturnsObjectWithCorrectNumberOfFootnotes()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();

            TrainTime testOutput = testObject.Copy();

            Assert.AreEqual(testOutput.Footnotes.Count, testObject.Footnotes.Count);
        }
Exemplo n.º 3
0
        public void TrainTimeClassCopyMethodReturnsObjectWithTimePropertyThatIsDifferentObjectIfTimePropertyIsNotNull()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();

            TrainTime testOutput = testObject.Copy();

            Assert.AreNotSame(testObject.Time, testOutput.Time);
        }
Exemplo n.º 4
0
        public void TrainTimeClassCopyMethodReturnsObjectWithTimePropertyWithCorrectValueIfTimePropertyIsNotNull()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();

            TrainTime testOutput = testObject.Copy();

            Assert.AreEqual(testObject.Time, testOutput.Time);
        }
Exemplo n.º 5
0
        public void TrainTimeClass_ResolveFootnotesMethod_ThrowsArgumentNullException_IfParameterIsNull()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();

            testObject.ResolveFootnotes(null);

            Assert.Fail();
        }
Exemplo n.º 6
0
        public void TrainTimeClassFootnoteSymbolsPropertyEqualsTwoSpacesIfThereAreNoFootnotes()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime(0);

            string testOutput = testObject.FootnoteSymbols;

            Assert.AreEqual("  ", testOutput);
        }
Exemplo n.º 7
0
        public void TrainTimeClass_EqualsMethod_ReturnsFalse_IfParameterIsNull()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            TrainTime testParam  = null;

            bool testOutput = testObject.Equals(testParam);

            Assert.IsFalse(testOutput);
        }
Exemplo n.º 8
0
        public void TrainTimeClassLessThanOrEqualToOperatorReturnsTrueIfTimePropertyOfFirstOperandIsEqualToTimePropertOfSecondOperand()
        {
            TrainTime testParam0 = TrainTimeHelpers.GetTrainTime();
            TrainTime testParam1 = TrainTimeHelpers.GetTrainTimeAt(testParam0.Time);

            bool testOutput = testParam0 <= testParam1;

            Assert.IsTrue(testOutput);
        }
Exemplo n.º 9
0
        public void TrainTimeClass_CompareToMethodWithObjectParameter_ReturnsOne_IfParameterIsTrainTimeObjectWithTimePropertyBeforeTimePropertyOfThisObject()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            object    testParam  = TrainTimeHelpers.GetTrainTimeBefore(testObject.Time);

            int testOutput = testObject.CompareTo(testParam);

            Assert.AreEqual(1, testOutput);
        }
Exemplo n.º 10
0
        public void TrainTimeClass_GetHashCodeMethod_ReturnsSameValueWhenCalledTwiceOnSameObject_IfObjectPropertiesHaveNotChanged()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();

            int testOutput0 = testObject.GetHashCode();
            int testOutput1 = testObject.GetHashCode();

            Assert.AreEqual(testOutput0, testOutput1);
        }
Exemplo n.º 11
0
        public void TrainTimeClass_CompareToMethodWithTrainTimeParameter_ReturnsMinusOne_IfParameterHasTimePropertyLaterThanTimePropertyOfThisObject()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            TrainTime testParam  = TrainTimeHelpers.GetTrainTimeAfter(testObject.Time);

            int testOutput = testObject.CompareTo(testParam);

            Assert.AreEqual(-1, testOutput);
        }
Exemplo n.º 12
0
        public void TrainTimeClassLessThanOperatorReturnsFalseIfTimePropertyOfFirstOperandIsAfterTimePropertyOfSecondOperand()
        {
            TrainTime testParam0 = TrainTimeHelpers.GetTrainTime();
            TrainTime testParam1 = TrainTimeHelpers.GetTrainTimeBefore(testParam0.Time);

            bool testOutput = testParam0 < testParam1;

            Assert.IsFalse(testOutput);
        }
Exemplo n.º 13
0
        public void TrainTimeClassLessThanOperatorReturnsTrueIfFirstOperandIsNullAndSecondOperandIsNotNull()
        {
            TrainTime testParam0 = null;
            TrainTime testParam1 = TrainTimeHelpers.GetTrainTime();

            bool testOutput = testParam0 < testParam1;

            Assert.IsTrue(testOutput);
        }
Exemplo n.º 14
0
        public void TrainTimeClassGreaterThanOperatorReturnsFalseIfFirstOperandIsNullAndSecondOperandIsNotNull()
        {
            TrainTime testParam0 = null;
            TrainTime testParam1 = TrainTimeHelpers.GetTrainTime();

            bool testOutput = testParam0 > testParam1;

            Assert.IsFalse(testOutput);
        }
Exemplo n.º 15
0
        public void TrainTimeClassCopyAndReflectMethodReturnsObjectWithCorrectNumberOfFootnotes()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            TimeOfDay testParam0 = _rnd.NextTimeOfDay();

            TrainTime testOutput = testObject.CopyAndReflect(testParam0);

            Assert.AreEqual(testOutput.Footnotes.Count, testObject.Footnotes.Count);
        }
Exemplo n.º 16
0
        public void TrainTimeClassCopyAndReflectMethodReturnsObjectWithTimePropertyWithExpectedValueIfTimePropertyIsNotNull()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            TimeOfDay testParam0 = _rnd.NextTimeOfDay();

            TrainTime testOutput = testObject.CopyAndReflect(testParam0);

            Assert.AreEqual(testObject.Time.CopyAndReflect(testParam0), testOutput.Time);
        }
Exemplo n.º 17
0
        public void TrainTimeClassCopyAndReflectMethodReturnsObjectWithTimePropertyThatIsDifferentObjectIfTimePropertyIsNotNull()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            TimeOfDay testParam0 = _rnd.NextTimeOfDay();

            TrainTime testOutput = testObject.CopyAndReflect(testParam0);

            Assert.AreNotSame(testObject.Time, testOutput.Time);
        }
Exemplo n.º 18
0
        public void TrainTimeClass_CompareToMethodWithTimeOfDayParameter_ReturnsMinusOne_IfParameterValueIsLaterThanValueOfTimeProperty()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            TimeOfDay testParam  = _rnd.NextTimeOfDayAfter(testObject.Time);

            int testOutput = testObject.CompareTo(testParam);

            Assert.AreEqual(-1, testOutput);
        }
Exemplo n.º 19
0
        public void TrainTimeClass_CompareToMethodWithTrainTimeParameter_ReturnsMinusOne_IfParameterIsNull()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            TrainTime testParam  = null;

            int testOutput = testObject.CompareTo(testParam);

            Assert.AreEqual(-1, testOutput);
        }
Exemplo n.º 20
0
        public void TrainTimeClass_CompareToMethodWithObjectParameter_ReturnsZero_IfParameterIsTimeOfDayObjectWithValueEqualToTimeProperty()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            object    testParam  = testObject.Time.Copy();

            int testOutput = testObject.CompareTo(testParam);

            Assert.AreEqual(0, testOutput);
        }
Exemplo n.º 21
0
        public void TrainTimeClass_CompareToMethodWithTrainTimeParameter_ReturnsZero_IfParameterHasTimePropertyEqualToTimePropertyOfThisObject()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            TrainTime testParam  = TrainTimeHelpers.GetTrainTimeAt(testObject.Time);

            int testOutput = testObject.CompareTo(testParam);

            Assert.AreEqual(0, testOutput);
        }
Exemplo n.º 22
0
        public void TrainTimeClassCopyAndReflectMethodReturnsDifferentObject()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            TimeOfDay testParam0 = _rnd.NextTimeOfDay();

            TrainTime testOutput = testObject.CopyAndReflect(testParam0);

            Assert.AreNotSame(testObject, testOutput);
        }
Exemplo n.º 23
0
        public void TrainTimeClass_CompareToMethodWithObjectParameter_ThrowsArgumentException_IfParameterTypeIsNotTrainTimeOrTimeOfDay()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            object    testParam  = new object();

            _ = testObject.CompareTo(testParam);

            Assert.Fail();
        }
Exemplo n.º 24
0
        public void TrainTimeClassGreaterThanOrEqualToOperatorReturnsFalseIfTimePropertyOfFirstOperandIsBeforeTimePropertyOfSecondOperand()
        {
            TrainTime testParam0 = TrainTimeHelpers.GetTrainTime();
            TrainTime testParam1 = TrainTimeHelpers.GetTrainTimeAfter(testParam0.Time);

            bool testOutput = testParam0 >= testParam1;

            Assert.IsFalse(testOutput);
        }
Exemplo n.º 25
0
        public void TrainTimeClass_CompareToMethodWithObjectParameter_ReturnsOne_IfParameterIsTimeOfDayObjectWithValueBeforeTimeProperty()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            object    testParam  = _rnd.NextTimeOfDayBefore(testObject.Time);

            int testOutput = testObject.CompareTo(testParam);

            Assert.AreEqual(1, testOutput);
        }
Exemplo n.º 26
0
        public void TrainTimeClassLessThanOrEqualToOperatorReturnsFalseIfFirstOperandIsNotNullAndSecondOperandIsNull()
        {
            TrainTime testParam0 = TrainTimeHelpers.GetTrainTime();;
            TrainTime testParam1 = null;

            bool testOutput = testParam0 <= testParam1;

            Assert.IsFalse(testOutput);
        }
Exemplo n.º 27
0
        public void TrainTimeClass_InequalityOperator_ReturnsTrue_IfFirstOperandIsNotNullAndSecondOperandIsNull()
        {
            TrainTime op0 = TrainTimeHelpers.GetTrainTime();
            TrainTime op1 = null;

            bool testOutput = op0 != op1;

            Assert.IsTrue(testOutput);
        }
Exemplo n.º 28
0
        public void TrainTimeClass_EqualityOperator_ReturnsFalse_IfFirstOperandIsNullAndSecondOperandIsNotNull()
        {
            TrainTime op0 = null;
            TrainTime op1 = TrainTimeHelpers.GetTrainTime();

            bool testOutput = op0 == op1;

            Assert.IsFalse(testOutput);
        }
Exemplo n.º 29
0
        public void TrainTimeClass_EqualsMethod_ReturnsTrue_IfParameterIsTheSameObject()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            TrainTime testParam  = testObject;

            bool testOutput = testObject.Equals(testParam);

            Assert.IsTrue(testOutput);
        }
Exemplo n.º 30
0
        public void TrainTimeClassCopyMethodReturnsObjectIfTimePropertyIsNull()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();

            testObject.Time = null;

            TrainTime testOutput = testObject.Copy();

            Assert.IsNull(testOutput.Time);
        }