public void ThrowExceptionIfTheTeamNameIsAlreadyTakenWhenAddingNewCarToTheRace() { var vehicle = VehicleBuilder.Build(); var vehicleToAdd = VehicleBuilder.BuildUpsertVehicleWithId(vehicle.Id); var race = RaceBuilder.BuildWithVehicles(vehicle); Exception ex = Assert.Throws <Exception>(() => race.AddVehicle(vehicleToAdd)); ex.Message.Should().Be($"Team name '{vehicleToAdd.TeamName}' is already taken."); }
public void ThrowExceptionIfTheTeamNameIsAlreadyTakenWhileTryingToUpdateVehicleInfo() { var vehicle = VehicleBuilder.Build(); var vehicleToUpdate = VehicleBuilder.BuildUpsertVehicleWithId(vehicle.Id); var race = RaceBuilder.BuildWithVehicles(vehicle); Exception ex = Assert.Throws <Exception>(() => race.UpdateVehicleInfo(vehicleToUpdate)); ex.Message.Should().Be($"Team name '{vehicleToUpdate.TeamName}' is already taken."); }