예제 #1
0
        public async Task IncrementCounter(string counterName)
        {
            var counter = (await counterService.GetAllCounters()).FirstOrDefault(c => c.Name.Equals(counterName));

            if (counter == null)
            {
                return;
            }
            await counterService.IncrementCount(counter);

            messenger.PostMessage(await CreateCountersChangedMessage());
        }
        public async Task IncrementCounter_AAA_AAAsCountAdded1()
        {
            // Arrange
            var counter      = new Counter("AAA");
            var initialCount = counter.Count;
            // Act
            await service.IncrementCount(counter);

            // Asseert
            Assert.IsTrue(initialCount < counter.Count);
            repository.Verify(r => r.SaveOrReplace(counter));
        }