public async Task IncrementCounter() { var counter = new Counter { Count = 0 }; await _subject.IncrementCounter(counter); counter.Count.ShouldBe(1); A.CallTo(() => _repo.Save(counter)).MustHaveHappenedOnceExactly(); }
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); }