コード例 #1
0
        public void GetTotalSeconds()
        {
            var instrumentation = new Instrumentation();

            instrumentation.Start();
            Thread.Sleep(750);
            Assert.AreEqual(1, instrumentation.GetElapsedTime());
        }
コード例 #2
0
        public void GetTotalSeconds()
        {
            var instrumentation = new Instrumentation();

            instrumentation.Start();
            Thread.Sleep(750);
            Assert.AreEqual(1, instrumentation.GetElapsedTime()); //passes bacause GetElapsedTime() rounds to whole seconds
        }
コード例 #3
0
        public void GetPreciseElapsedTime()
        {
            var instrumentation = new Instrumentation();

            instrumentation.Start();
            Thread.Sleep(750);
            var elapsed = instrumentation.GetElapsedTime();

            Assert.IsTrue(elapsed >= 0.75 && elapsed <= 1);
        }
コード例 #4
0
        public void StartTest()
        {
            //-- Arrange
            Instrumentation instrumentation = new Instrumentation();

            //-- Act
            instrumentation.Start();

            Thread.Sleep(750);

            int actual = instrumentation.GetElapsedTime();

            Debug.Write(actual);

            //-- Assert
            Assert.AreEqual(1, actual);
        }