public void InvariantBreaksOnOutOfRangeSeconds(int seconds) { var clock = new ClockIn24H(); clock.Invariant.Should().BeTrue(); clock.AddSeconds(seconds); clock.Invariant.Should().BeFalse(); }
public void AddSecondsRollsMinuteAndHour(int seconds, int expectedHour, int expectedMinute, int expectedSecond) { var clock = new ClockIn24H(0, 59, 59); clock.Hour.Should().Be(0); clock.Minute.Should().Be(59); clock.Second.Should().Be(59); clock.Invariant.Should().BeTrue(); clock.AddSeconds(seconds); clock.Invariant.Should().BeTrue(); clock.Hour.Should().Be(expectedHour); clock.Minute.Should().Be(expectedMinute); clock.Second.Should().Be(expectedSecond); }