Ejemplo n.º 1
0
        public async Task IncrementCounter_IncrementsTheCounter()
        {
            var counter = new Counter {
                Count = 0
            };
            await service.IncrementCounter(counter);

            Assert.AreEqual(1, counter.Count);
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
0
        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
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 6
0
        async Task IncrementCounter()
        {
            await service.IncrementCounter(counter);

            RaisePropertyChanged(() => Count);
        }
Ejemplo n.º 7
0
        public async Task IncrementCounter()
        {
            await _subject.IncrementCommand.ExecuteAsync();

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