public async void WithCorrectId_ShouldDeleteModelType() { var dbContext = this.GetDbContext(); var dbOptionType = SeedOptionTypesMethods.SeedOptionType(dbContext); var service = this.GetService(dbContext); await service.DeleteAsync(dbOptionType.Id); Assert.Empty(dbContext.OptionTypes); }
public async void WithCorrectId_ShouldReturnOptionType() { var dbContext = this.GetDbContext(); var dbOptionType = SeedOptionTypesMethods.SeedOptionType(dbContext); var service = this.GetService(dbContext); var model = await service.GetByIdAsync(dbOptionType.Id); Assert.NotNull(model); }
public void WithModelType_ShouldReturnOptionTypeWithCorrectName() { var dbContext = this.GetDbContext(); var dbOptionType = SeedOptionTypesMethods.SeedOptionType(dbContext); var service = this.GetService(dbContext); var models = service.GetAll(); Assert.Single(models); Assert.Equal(dbOptionType.Name, models.First().Name); }
public async void WithCorrectId_ShouldEditOptionType() { var dbContext = this.GetDbContext(); var service = this.GetService(dbContext); var dbOptionType = SeedOptionTypesMethods.SeedOptionType(dbContext); var name = Guid.NewGuid().ToString(); var model = OptionTypeServiceModelMethods.Create(dbOptionType.Id, name); await service.EditAsync(model); Assert.Equal(model.Name, dbOptionType.Name); }