Exemplo n.º 1
0
        public async Task AddVehicleAsync()
        {
            // Arrange
            var vehicle = _testVehicle1;

            // Act
            await _vehicleService.AddVehicleAsync(vehicle);

            // Assert
            var vehiclesInDb = await _context.Vehicles.ToListAsync();

            var vehicleInDb = vehiclesInDb[0];

            Assert.AreEqual(1, vehiclesInDb.Count);
            Assert.AreEqual(vehicle.ModelYear.Model.Make.Name, vehicleInDb.ModelYear.Model.Make.Name);
            Assert.AreEqual(vehicle.Condition, vehicleInDb.Condition);
        }