コード例 #1
0
        public void TrainTimeClassLessThanOrEqualToOperatorReturnsFalseIfTimePropertyOfFirstOperandIsAfterTimePropertyOfSecondOperand()
        {
            TrainTime testParam0 = TrainTimeHelpers.GetTrainTime();
            TrainTime testParam1 = TrainTimeHelpers.GetTrainTimeBefore(testParam0.Time);

            bool testOutput = testParam0 <= testParam1;

            Assert.IsFalse(testOutput);
        }
コード例 #2
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);
        }
コード例 #3
0
        public void TrainTimeClassGreaterThanOperatorReturnsTrueIfTimePropertyOfFirstOperandIsAfterTimePropertyOfSecondOperand()
        {
            TrainTime testParam0 = TrainTimeHelpers.GetTrainTime();
            TrainTime testParam1 = TrainTimeHelpers.GetTrainTimeBefore(testParam0.Time);

            bool testOutput = testParam0 > testParam1;

            Assert.IsTrue(testOutput);
        }
コード例 #4
0
 private static TrainLocationTime GetTrainLocationTime(TimeOfDay beforeTime)
 {
     return(new TrainLocationTime
     {
         ArrivalTime = TrainTimeHelpers.GetTrainTimeBefore(beforeTime),
         DepartureTime = TrainTimeHelpers.GetTrainTimeBefore(beforeTime),
         FormattingStrings = new TimeDisplayFormattingStrings
         {
             Complete = "h{0}mmf",
             Hours = "h",
             Minutes = "mmf",
             TimeWithoutFootnotes = "h mmf",
         },
         Line = _rnd.NextString(_rnd.Next(2)),
         Location = new Location(),
         Pass = _rnd.NextBoolean(),
         Path = _rnd.NextString(_rnd.Next(2)),
         Platform = _rnd.NextString(_rnd.Next(2)),
     });
 }