示例#1
0
        public async Task IncrementCounter_IncrementsTheCounter()
        {
            var counter = new Counter {
                Count = 0
            };
            await service.IncrementCounter(counter);

            Assert.AreEqual(1, counter.Count);
        }
示例#2
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();
        }
        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
        }
示例#4
0
        public async Task IncrementCounter_IncrementsTheCounter()
        {
            // Arrange
            var counter = new Counter {
                Count = 0
            };
            // Act
            await service.IncrementCounter(counter);

            // Assert
            Assert.AreEqual(1, counter.Count);
        }
示例#5
0
        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);
        }
示例#6
0
        async Task IncrementCounter()
        {
            await service.IncrementCounter(counter);

            RaisePropertyChanged(() => Count);
        }
示例#7
0
        public async Task IncrementCounter()
        {
            await _subject.IncrementCommand.ExecuteAsync();

            A.CallTo(() => _service.IncrementCounter(A <Counter> .Ignored)).MustHaveHappenedOnceExactly();
        }