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

            var result = service.GetById <TestHallViewModel>(2);

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

            var diffHall = new AddHallInputModel
            {
                ProjectionType = "FourDx",
                Seats          = 100,
            };

            await service.AddAsync(this.hall);

            await service.AddAsync(diffHall);

            var result = service.GetById <TestHallViewModel>(2);

            Assert.Equal(ProjectionType.FourDx, result.ProjectionType);
        }