예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }