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); }
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); }