コード例 #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
ファイル: GetAllTests.cs プロジェクト: sevgin0954/BMWStore
        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
ファイル: EditAsyncTests.cs プロジェクト: sevgin0954/BMWStore
        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);
        }