예제 #1
0
 /// <summary>
 /// Asserts that a <see cref="TimeToken"/> is an instance of the <see cref="SpecialTimeToken"/> class and that
 /// its value is equal to the specified parameters.
 /// </summary>
 /// <param name="actual">The actual <see cref="TimeToken"/>.</param>
 /// <param name="expectedSpecialTime">The expected <see cref="SpecialTime"/>.</param>
 private static void AssertAreEqual(TimeToken actual, SpecialTime expectedSpecialTime)
 {
     Assert.AreEqual(typeof(SpecialTimeToken), actual.GetType());
     Assert.AreEqual(expectedSpecialTime, ((SpecialTimeToken)actual).SpecialTime);
 }
예제 #2
0
 /// <summary>
 /// Asserts that a <see cref="TimeToken"/> is an instance of the <see cref="EmptyTimeToken"/> class.
 /// </summary>
 /// <param name="actual">The actual <see cref="TimeToken"/>.</param>
 private static void AssertIsEmpty(TimeToken actual)
 {
     Assert.AreEqual(typeof(EmptyTimeToken), actual.GetType());
 }
예제 #3
0
 /// <summary>
 /// Asserts that a <see cref="TimeToken"/> is an instance of the <see cref="NormalTimeToken"/> class and that
 /// its value is equal to the specified parameters.
 /// </summary>
 /// <param name="actual">The actual <see cref="TimeToken"/>.</param>
 /// <param name="expectedHourPeriod">The expected <see cref="HourPeriod"/>.</param>
 /// <param name="expectedHour">The expected hour.</param>
 /// <param name="expectedMinute">The expected minute.</param>
 /// <param name="expectedSecond">The expected second.</param>
 private static void AssertAreEqual(TimeToken actual, HourPeriod expectedHourPeriod, int expectedHour, int expectedMinute = 0, int expectedSecond = 0)
 {
     Assert.AreEqual(typeof(NormalTimeToken), actual.GetType());
     Assert.AreEqual(expectedHourPeriod, ((NormalTimeToken)actual).HourPeriod);
     Assert.AreEqual(expectedHour, ((NormalTimeToken)actual).Hour);
     Assert.AreEqual(expectedMinute, ((NormalTimeToken)actual).Minute);
     Assert.AreEqual(expectedSecond, ((NormalTimeToken)actual).Second);
 }