Esempio n. 1
0
        public async void FindAll_ShouldReturnAListOfProductsWithoutItsProvidersAndCategories()
        {
            // Arrange
            var products = _productTestsFixture.GetValidProducts(false);

            _productRepositoryMock.Setup(r => r.FindAll(false, false))
            .Returns(Task.FromResult(products));

            // Act
            var result = await _productService.FindAll(false, false);

            // Assert

            _productRepositoryMock.Verify(x => x.FindAll(false, false), Times.Once);
            result.Should().BeEquivalentTo(products);
            result.ForEach(x => x.Category.Should().BeNull());
            result.ForEach(x => x.Provider.Should().BeNull());
        }