Exemplo n.º 1
0
        public async Task ListAsyncWhenNoDietsReturnsEmptyCollection()
        {
            var mockDietRepository = GetDefaultIDietRepositoryInstance();

            mockDietRepository.Setup(r => r.ListAsync())
            .ReturnsAsync(new List <Diet>());
            var mockUnitOfWork = GetDefaultIUnitOfWorkInstance();
            var service        = new DietService(
                mockDietRepository.Object,
                mockUnitOfWork.Object);

            // Act
            List <Diet> result = (List <Diet>) await service.ListAsync();

            int dietsCount = result.Count;

            // Assert
            dietsCount.Should().Equals(0);
        }
Exemplo n.º 2
0
        public async void ThenTheSystemShouldShowTheDietListUploadedToThePlatformByHim()
        {
            var response = await dietService.ListAsync();

            response.Count().Should().Be(1);
        }