Beispiel #1
0
        public void Test_ShouldThrowInvalidOperationExceptionWhenStoppingAgain()
        {
            var stoper = new MyStoper();

            stoper.Start();
            stoper.Stop();

            Assert.Throws <InvalidOperationException>(() => stoper.Stop());
        }
Beispiel #2
0
        public void Test_ShouldReturnNotNullTime()
        {
            var stoper = new MyStoper();

            stoper.Start();
            stoper.Stop();
            stoper.Start();
            stoper.Stop();

            double?time = stoper.Time;

            Assert.True(time is not null);
        }
Beispiel #3
0
        public void Test_ShouldThrowInvalidOperationExceptionAfterRestarting()
        {
            var stoper = new MyStoper();

            stoper.Start();
            stoper.Stop();
            stoper.Restart();

            Assert.Throws <ArgumentException>(() => stoper.Time);
        }