Пример #1
0
        public void InvariantBreaksOnOutOfRangeHour(int hour)
        {
            var stopwatch = new Stopwatch();

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

            stopwatch.AddHours(hour);

            stopwatch.Invariant.Should().BeFalse();
        }
Пример #2
0
        public void AddHourAddsHour(int hour)
        {
            var stopwatch = new Stopwatch();

            stopwatch.Hour.Should().Be(0);
            stopwatch.Minute.Should().Be(0);
            stopwatch.Second.Should().Be(0);
            stopwatch.Invariant.Should().BeTrue();

            stopwatch.AddHours(hour);

            stopwatch.Invariant.Should().BeTrue();
            stopwatch.Hour.Should().Be(hour);
            stopwatch.Minute.Should().Be(0);
            stopwatch.Second.Should().Be(0);
        }