Esempio n. 1
0
        public void Plants_GetAll_ReturnsEmpty()
        {
            //Arrange
            var plantsInitialDBSet = _dbContextMock.CreateDbSetMock(x => x.Plant);
            var service            = new PlantsServices(_dbContextMock.Object, _mapper);

            //Act
            var result = service.GetAll();

            //Assert
            Assert.NotNull(result);
            Assert.Empty(result);
        }
Esempio n. 2
0
        public void Plants_GetAll_ReturnsOneElement()
        {
            //Arrange
            var plantsInitialDBSet = _dbContextMock.CreateDbSetMock(x => x.Plant, new[] { new Plant {
                                                                                          } });
            var service            = new PlantsServices(_dbContextMock.Object, _mapper);

            //Act
            var result = service.GetAll();

            //Assert
            Assert.NotNull(result);
            Assert.NotEmpty(result);
            Assert.True(result.Any());
        }