Ejemplo n.º 1
0
        public void IncreaseCount_ByOne()
        {
            var context = new TestCountContext();
            var service = new CounterService(context);
            var count   = service.IncreaseCount();

            Assert.AreEqual(count, 1);
            count = service.IncreaseCount();
            Assert.AreEqual(count, 2);
        }
Ejemplo n.º 2
0
        public void IncreaseCount_NotSurpassTen()
        {
            var context = new TestCountContext();
            var service = new CounterService(context);
            var count   = service.IncreaseCount();

            Assert.AreEqual(count, 1);
            count = service.IncreaseCount();
            Assert.AreEqual(count, 2);
            count = service.IncreaseCount();
            Assert.AreEqual(count, 3);
            count = service.IncreaseCount();
            Assert.AreEqual(count, 4);
            count = service.IncreaseCount();
            Assert.AreEqual(count, 5);
            count = service.IncreaseCount();
            Assert.AreEqual(count, 6);
            count = service.IncreaseCount();
            Assert.AreEqual(count, 7);
            count = service.IncreaseCount();
            Assert.AreEqual(count, 8);
            count = service.IncreaseCount();
            Assert.AreEqual(count, 9);
            count = service.IncreaseCount();
            Assert.AreEqual(count, 10);
            count = service.IncreaseCount();
            Assert.AreEqual(count, 10);
        }