Exemple #1
0
        public void TrainTimeClass_InequalityOperator_ReturnsTrue_IfOperandTimesAreDifferentAndFootnotesAreSame()
        {
            TrainTime op0 = TrainTimeHelpers.GetTrainTime();
            TrainTime op1 = TrainTimeHelpers.GetTrainTimeNotAt(op0.Time, 0);

            op1.Footnotes.AddRange(op0.Footnotes.Select(n => n.Copy()));

            bool testOutput = op0 != op1;

            Assert.IsTrue(testOutput);
        }
Exemple #2
0
        public void TrainTimeClass_EqualsMethod_ReturnsFalse_IfParameterTimeIsNotEqualToObjectTimeAndParameterFootnotesAreEqualToObjectFootnotes()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            TrainTime testParam  = TrainTimeHelpers.GetTrainTimeNotAt(testObject.Time, 0);

            testParam.Footnotes.AddRange(testObject.Footnotes.Select(n => n.Copy()));

            bool testOutput = testObject.Equals(testParam);

            Assert.IsFalse(testOutput);
        }
Exemple #3
0
        public void TrainTimeClass_GetHashCodeMethod_ReturnsDifferentValueWhenCalledOnDifferentObjects_IfObjectsHaveDifferentTimeProperty()
        {
            TrainTime testObject0 = TrainTimeHelpers.GetTrainTime();
            TrainTime testObject1 = TrainTimeHelpers.GetTrainTimeNotAt(testObject0.Time, 0);

            testObject1.Footnotes.AddRange(testObject0.Footnotes.Select(n => n.Copy()));

            int testOutput0 = testObject0.GetHashCode();
            int testOutput1 = testObject1.GetHashCode();

            Assert.AreNotEqual(testOutput0, testOutput1);
        }
Exemple #4
0
        public void TrainTimeClass_InequalityOperator_ReturnsTrue_IfOperandTimesAreDifferentAndFootnotesAreDifferent()
        {
            TrainTime op0 = TrainTimeHelpers.GetTrainTime();
            TrainTime op1;

            do
            {
                op1 = TrainTimeHelpers.GetTrainTimeNotAt(op0.Time);
            } while (op0.FootnoteSymbols == op1.FootnoteSymbols);

            bool testOutput = op0 != op1;

            Assert.IsTrue(testOutput);
        }
Exemple #5
0
        public void TrainTimeClass_EqualsMethod_ReturnsFalse_IfParameterTimeAndFootnotesAreDifferentToObjectTimeAndFootnotes()
        {
            TrainTime testObject = TrainTimeHelpers.GetTrainTime();
            TrainTime testParam;

            do
            {
                testParam = TrainTimeHelpers.GetTrainTimeNotAt(testObject.Time);
            } while (testObject.FootnoteSymbols == testParam.FootnoteSymbols);

            bool testOutput = testObject.Equals(testParam);

            Assert.IsFalse(testOutput);
        }