public async void WithCorrectId_ShouldDeleteModelType() { var dbContext = this.GetDbContext(); var dbModelType = SeedModelTypesMethods.SeedModelType(dbContext); var service = this.GetService(dbContext); await service.DeleteAsync(dbModelType.Id); Assert.Empty(dbContext.ModelTypes); }
public void WithModelType_ShouldReturnModelTypeWithCorrectName() { var dbContext = this.GetDbContext(); var dbModelType = SeedModelTypesMethods.SeedModelType(dbContext); var service = this.GetService(dbContext); var models = service.GetAll(); Assert.Single(models); Assert.Equal(dbModelType.Name, models.First().Name); }
public async void WithCorrectId_ShouldEditEngine() { var dbContext = this.GetDbContext(); var service = this.GetService(dbContext); var dbModelType = SeedModelTypesMethods.SeedModelType(dbContext); var name = Guid.NewGuid().ToString(); var model = ModelTypeServiceModelMethods.Create(dbModelType.Id, name); await service.EditAsync(model); Assert.Equal(model.Name, dbModelType.Name); }