public async Task IncrementCounter_IncrementsTheCounter() { var counter = new Counter { Count = 0 }; await service.IncrementCounter(counter); Assert.AreEqual(1, counter.Count); }
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 IncrementCounter_IncrementsTheCounter() //Instead of returning void, these tests are async Task methods, so they can await async methods on the service { // Arrange var counter = new Counter { Count = 0 }; // Act await service.IncrementCounter(counter); // Assert Assert.AreEqual(1, counter.Count); //This asserts that the counter now has a Count of 1 }
public async Task IncrementCounter_IncrementsTheCounter() { // Arrange var counter = new Counter { Count = 0 }; // Act await service.IncrementCounter(counter); // Assert Assert.AreEqual(1, counter.Count); }
async Task IncrementCounter() //The method called by the command increments the counter using the service and then raises a property-changed notification for the count { await service.IncrementCounter(counter); RaisePropertyChanged(() => Count); }
async Task IncrementCounter() { await service.IncrementCounter(counter); RaisePropertyChanged(() => Count); }
public async Task IncrementCounter() { await _subject.IncrementCommand.ExecuteAsync(); A.CallTo(() => _service.IncrementCounter(A <Counter> .Ignored)).MustHaveHappenedOnceExactly(); }