Beispiel #1
0
        public async void WithCorrectId_ShouldDeleteEngine()
        {
            var dbContext = this.GetDbContext();
            var dbEngine  = SeedEnginesMethods.SeedEngine(dbContext);
            var service   = this.GetService(dbContext);

            await service.DeleteAsync(dbEngine.Id);

            Assert.Empty(dbContext.Engines);
        }
Beispiel #2
0
        public async void WithCorrectId_ShouldReturnModel()
        {
            var dbContext = this.GetDbContext();
            var dbEngine  = SeedEnginesMethods.SeedEngineWithTransmission(dbContext);
            var service   = this.GetService(dbContext);

            var model = await service.GetByIdAsync(dbEngine.Id);

            Assert.NotNull(model);
        }
Beispiel #3
0
        public async void WithCorrectId_ShouldEditEngine()
        {
            var dbContext = this.GetDbContext();
            var service   = this.GetService(dbContext);
            var dbEngine  = SeedEnginesMethods.SeedEngine(dbContext);
            var name      = Guid.NewGuid().ToString();

            var model = EngineServiceModelMethods.Create(dbEngine.Id, name);

            await service.EditAsync(model);

            Assert.Equal(model.Name, dbEngine.Name);
        }