public async void WithEntitiesCount_ShouldReturnCorrectEntitiesCount() { var dbContext = this.GetDbContext(); SeedSeriesMethods.SeedSeries(dbContext); var countResult = await PaginationHelper.CountTotalPagesCountAsync(dbContext.Series); Assert.Equal(1, countResult); }
public async void WithCorrectId_ShouldReturnSeries() { var dbContext = this.GetDbContext(); var dbSeries = SeedSeriesMethods.SeedSeries(dbContext); var service = this.GetService(dbContext); var model = await service.GetByIdAsync(dbSeries.Id); Assert.NotNull(model); }
public async void WithCorrectId_ShouldDeleteSeries() { var dbContext = this.GetDbContext(); var dbSeries = SeedSeriesMethods.SeedSeries(dbContext); var service = this.GetService(dbContext); await service.DeleteAsync(dbSeries.Id); Assert.Empty(dbContext.Engines); }
public void WithSeries_ShouldReturnSeries() { var dbContext = this.GetDbContext(); SeedSeriesMethods.SeedSeries(dbContext); var service = this.GetService(dbContext); var models = service.GetAll(); Assert.Single(models); }
public async void WithCorrectId_ShouldEditSeriesName() { var dbContext = this.GetDbContext(); var dbSeries = SeedSeriesMethods.SeedSeries(dbContext); var service = this.GetService(dbContext); var model = SeriesServiceModelMethods.Create(dbSeries.Id); await service.EditAsync(model); Assert.Equal(model.Name, dbSeries.Name); }