Exemplo n.º 1
0
        public async void get_apps_should_return_with_paged_list_app()
        {
            //arrange 
            var appRepository = new Mock<IRepository<App>>();
            appRepository.Setup(x => x.FindOne(It.IsAny<Expression<Func<App, bool>>>())).Returns(It.IsAny<App>);

            //act
            var sut = new AppServiceBuilder().WithAppRepository(appRepository.Object)
                                             .Build();
            var list = await sut.GetApps(1);

            //assert
            Assert.NotNull(list);
            Assert.IsAssignableFrom<PagedList<App>>(list);

            appRepository.Verify(x => x.FindAll(It.IsAny<Expression<Func<App, bool>>>()), Times.Once);
        }