Decrement() public method

public Decrement ( string name ) : int
name string
return int
        public void GivenEmptyResourceCounterThenShouldReturnZeroCountOnDecrement()
        {
            var resourceCounter = new ResourceCounter();

            Assert.AreEqual(0, resourceCounter.Decrement(ID));
            Assert.AreEqual(0, resourceCounter.Decrement(ID));
        }
        public void GivenTwoIncrementAndOneDecrementThenShouldReturnOne()
        {
            var resourceCounter = new ResourceCounter();

            resourceCounter.Increment(ID);
            resourceCounter.Increment(ID);

            Assert.AreEqual(1, resourceCounter.Decrement(ID));
            Assert.AreEqual(0, resourceCounter.Decrement(ID));
        }
        public void GivenMultipleIncrementThenEachDecrementShouldDecreaseTheCountToZero()
        {
            var resourceCounter = new ResourceCounter();

            resourceCounter.Increment(ID);
            resourceCounter.Increment(ID);
            resourceCounter.Increment(ID);
            resourceCounter.Increment(ID);
            resourceCounter.Increment(ID);
            resourceCounter.Increment(ID);
            resourceCounter.Increment(ID);
            resourceCounter.Increment(ID);
            resourceCounter.Increment(ID);
            resourceCounter.Increment(ID);

            Assert.AreEqual(9, resourceCounter.Decrement(ID));
            Assert.AreEqual(8, resourceCounter.Decrement(ID));
            Assert.AreEqual(7, resourceCounter.Decrement(ID));
            Assert.AreEqual(6, resourceCounter.Decrement(ID));
            Assert.AreEqual(5, resourceCounter.Decrement(ID));
            Assert.AreEqual(4, resourceCounter.Decrement(ID));
            Assert.AreEqual(3, resourceCounter.Decrement(ID));
            Assert.AreEqual(2, resourceCounter.Decrement(ID));
            Assert.AreEqual(1, resourceCounter.Decrement(ID));
            Assert.AreEqual(0, resourceCounter.Decrement(ID));
            Assert.AreEqual(0, resourceCounter.Decrement(ID));
        }