コード例 #1
0
        public async Task IncrementCounter()
        {
            var counter = new Counter {
                Count = 0
            };
            await _subject.IncrementCounter(counter);

            counter.Count.ShouldBe(1);
            A.CallTo(() => _repo.Save(counter)).MustHaveHappenedOnceExactly();
        }
コード例 #2
0
        public async Task <Counter> AddNewCounter(string name)
        {
            var counter = new Counter {
                Name = name
            };
            await _repository.Save(counter).ConfigureAwait(false);

            _messenger.Publish(new CountersChangedMessage(this));
            return(counter);
        }