Ejemplo n.º 1
0
        public void CounteResetDoNotSetValueToZero()
        {
            var counter = new CounterImplementation("test", new TelemetryContext());

            for (int i = 0; i < 10; i++)
            {
                counter.Decrement(2);
            }

            Assert.AreEqual(-20, counter.GetValueAndReset().Value);
            Assert.AreEqual(-20, counter.GetValueAndReset().Value);
        }
        public void CounteResetDoNotSetValueToZero()
        {
            var counter = new CounterImplementation("test", new TelemetryContext());

            for (int i = 0; i < 10; i++)
            {
                counter.Decrement(2);
            }

            Assert.AreEqual(-20, counter.GetValueAndReset().Value);
            Assert.AreEqual(-20, counter.GetValueAndReset().Value);
        }
        public void CounterIncrementWorks()
        {
            var counter = new CounterImplementation("test", new TelemetryContext());

            for (int i = 0; i < 10; i++)
            {
                counter.Increment();
            }

            Assert.AreEqual(10, counter.GetValueAndReset().Value);
        }
Ejemplo n.º 4
0
        public void CounterDecrementWorks()
        {
            var counter = new CounterImplementation("test", new TelemetryContext());

            for (int i = 0; i < 10; i++)
            {
                counter.Decrement();
            }

            Assert.AreEqual(-10, counter.GetValueAndReset().Value);
        }