示例#1
0
        public void GetAllShouldReturnEmptyList()
        {
            var repository = new EfDeletableEntityRepository <Hall>(new ApplicationDbContext(this.options.Options));
            var service    = new HallsService(repository);

            var result = service.GetAll <TestHallViewModel>();

            Assert.Empty(result);
        }
示例#2
0
        public async Task GetAllShouldReturnCorrectData()
        {
            var repository = new EfDeletableEntityRepository <Hall>(new ApplicationDbContext(this.options.Options));
            var service    = new HallsService(repository);

            await service.AddAsync(this.hall);

            await service.AddAsync(this.hall);

            var result = service.GetAll <TestHallViewModel>();

            Assert.Equal(2, result.Count());
            Assert.Equal(ProjectionType.TwoD, result.FirstOrDefault().ProjectionType);
        }