Esempio n. 1
0
        //[InlineData(86400)]
        public void InvariantBreaksOnOutOfRangeSeconds(int seconds)
        {
            var stopwatch = new Stopwatch();

            stopwatch.Invariant.Should().BeTrue();

            stopwatch.AddSeconds(seconds);

            stopwatch.Invariant.Should().BeFalse();
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
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);
        }