Ejemplo n.º 1
0
        public void The_accumulator_should_propertly_keep_track_of_good_and_evil()
        {
            ExecutionMonitor monitor = new ExecutionMonitor(typeof (Counter_Specs), "Test");

            SuccessRateMonitor aggregate = new SuccessRateMonitor(typeof (Counter_Specs), "Test", monitor);

            monitor.IncrementCompleted();
            monitor.IncrementFailed();

            Assert.AreEqual(50, aggregate.SuccessRate);
        }
Ejemplo n.º 2
0
        public void A_counter_should_increment()
        {
            ExecutionMonitor monitor = new ExecutionMonitor(typeof (Counter_Specs), "Test");

            monitor.IncrementStarted();
            monitor.IncrementCompleted();

            Assert.AreEqual(1, monitor.Started);
            Assert.AreEqual(1, monitor.Completed);
            Assert.AreEqual(0, monitor.Failed);
        }