コード例 #1
0
        public void Decrement_by_hours_removes_changes_to_max_value_if_hour_reaches_zero()
        {
            // Arrange
            var timeOfDay = new TimeOfDay(5, 30, 24);

            // Act
            timeOfDay.DecrementByHour(6);

            // Assert
            timeOfDay.ShouldBeEquivalentTo(new TimeOfDay(23, 30, 24), "the time of day did not roll backwards into the previous day.");
        }
コード例 #2
0
        public void Decrement_by_hours_removes_changes_to_max_value_if_hour_reaches_zero()
        {
            // Arrange
            var timeOfDay = new TimeOfDay(5, 30, 24);

            // Act
            timeOfDay.DecrementByHour(6);

            // Assert
            Assert.AreEqual(23, timeOfDay.Hour, "The hour value was not set.");
        }
コード例 #3
0
        public void Decrement_by_hour_removes_hour_from_property()
        {
            // Arrange
            var timeOfDay = new TimeOfDay(5, 30);

            // Act
            timeOfDay.DecrementByHour(2);

            // Assert
            timeOfDay.ShouldBeEquivalentTo(new TimeOfDay(3, 30), "the time of day was not equal to 3:30.");
        }
コード例 #4
0
        public void Decrement_by_hour_removes_hour_from_property()
        {
            // Arrange
            var timeOfDay = new TimeOfDay(5, 30);

            // Act
            timeOfDay.DecrementByHour(2);

            // Assert
            Assert.AreEqual(3, timeOfDay.Hour, "The hour value was not set.");
        }