Пример #1
0
        public async Task AllWithNulllId()
        {
            ApplicationDbContext dbContext = new ApplicationDbContext(new DbContextOptionsBuilder <ApplicationDbContext>()
                                                                      .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()).Options);
            var service = new GalleryService(new EfDeletableEntityRepository <Pic>(dbContext));

            for (int i = 1; i < 6; i++)
            {
                await service.AddAsync(
                    "http://wwww.test.img" + i,
                    "1");
            }

            int page        = 1;
            int itemPerPage = 3;
            var pics        = service.All <GuestViewModel>(null, itemPerPage, (page - 1) * itemPerPage);
            int count       = 0;

            foreach (var pic in pics)
            {
                count++;
            }

            Assert.Equal(0, count);
        }
Пример #2
0
 public ActionResult Index()
 {
     return(View(_repository.All()));
 }