//[InlineData(86400)] public void InvariantBreaksOnOutOfRangeSeconds(int seconds) { var stopwatch = new Stopwatch(); stopwatch.Invariant.Should().BeTrue(); stopwatch.AddSeconds(seconds); stopwatch.Invariant.Should().BeFalse(); }
public void AddSecondAddsSecond2() { var stopwatch = new Stopwatch(23, 59, 59); stopwatch.Hour.Should().Be(23); stopwatch.Minute.Should().Be(59); stopwatch.Second.Should().Be(59); stopwatch.Invariant.Should().BeTrue(); stopwatch.AddSeconds(1); stopwatch.Invariant.Should().BeTrue(); stopwatch.Hour.Should().Be(24); stopwatch.Minute.Should().Be(0); stopwatch.Second.Should().Be(0); }
public void AddSecondAddsSecond(int seconds, int expectedHour, int expectedMinute, int expectedSecond) { var stopwatch = new Stopwatch(); stopwatch.Hour.Should().Be(0); stopwatch.Minute.Should().Be(0); stopwatch.Second.Should().Be(0); stopwatch.Invariant.Should().BeTrue(); stopwatch.AddSeconds(seconds); stopwatch.Invariant.Should().BeTrue(); stopwatch.Hour.Should().Be(expectedHour); stopwatch.Minute.Should().Be(expectedMinute); stopwatch.Second.Should().Be(expectedSecond); }