Ejemplo n.º 1
0
        public async void WithCorrectId_ShouldEditTransmissionPrice()
        {
            var dbContext     = this.GetDbContext();
            var service       = this.GetService(dbContext);
            var dbTransmision = SeedTransmissionsMethods.SeedTransmission(dbContext);
            var model         = TransmissionServiceModelMethods.Create(dbTransmision.Id);

            await service.EditAsync(model);

            Assert.Equal(model.Price, dbTransmision.Price);
        }
Ejemplo n.º 2
0
        public async void WithIncorrectId_ShouldThrowException()
        {
            var dbContext   = this.GetDbContext();
            var service     = this.GetService(dbContext);
            var incorrectId = Guid.NewGuid().ToString();
            var model       = TransmissionServiceModelMethods.Create(incorrectId);

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

            Assert.Equal(ErrorConstants.IncorrectId, exception.Message);
        }