Esempio n. 1
0
        public async void WithIncorrectId_ShouldThrowException()
        {
            var dbContext = this.GetDbContext();
            var service   = this.GetService(dbContext);
            var id        = Guid.NewGuid().ToString();

            var model = EngineServiceModelMethods.Create(id);

            var exception = await Assert.ThrowsAsync <ArgumentException>(async() => await service.EditAsync(model));

            Assert.Equal(ErrorConstants.IncorrectId, exception.Message);
        }
Esempio n. 2
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);
        }