示例#1
0
        public void AddFollowerAsync_ReturnsCorrect()
        {
            // Arrange
            _repoWrapper
            .Setup(x => x.Region.GetFirstAsync(It.IsAny <Expression <Func <Region, bool> > >(),
                                               It.IsAny <Func <IQueryable <Region>, IIncludableQueryable <Region, object> > >()))
            .ReturnsAsync(new Region()
            {
                ID = 2
            });

            _repoWrapper.Setup(x => x.City.GetFirstAsync(It.IsAny <Expression <Func <DataAccess.Entities.City, bool> > >(),
                                                         It.IsAny <Func <IQueryable <DataAccess.Entities.City>, IIncludableQueryable <DataAccess.Entities.City, object> > >()))
            .ReturnsAsync(new DataAccess.Entities.City());

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

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