Пример #1
0
        public void EditRegionAsync_ReturnsCorrect()
        {
            // Arrange

            Region reg = new Region()
            {
                ID = 2
            };
            RegionDTO region = new RegionDTO()
            {
                ID = 3, City = "Lviv"
            };

            _repoWrapper
            .Setup(x => x.Region.GetFirstAsync(It.IsAny <Expression <Func <Region, bool> > >(),
                                               It.IsAny <Func <IQueryable <Region>, IIncludableQueryable <Region, object> > >()))
            .ReturnsAsync(reg);

            _repoWrapper
            .Setup(x => x.Region.Update(reg));

            _repoWrapper
            .Setup(x => x.SaveAsync());
            // Act
            var result = _regionService.EditRegionAsync(It.IsAny <int>(), region);

            // Assert
            _repoWrapper.Verify();
            Assert.NotNull(result);
        }