public void ThrowExceptionIfTheRaceIsRunningAndVehicleIsTryingToBeAddedToTheRace() { var vehicleToAdd = VehicleBuilder.BuildUpsertVehicle(); var race = RaceBuilder.BuildRaceWithRunningStatus(); Exception ex = Assert.Throws <Exception>(() => race.AddVehicle(vehicleToAdd)); ex.Message.Should().Be("Cannot add vehicle to the race that is running."); }
public void AddVehicleToTheRace() { var vehicleToAdd = VehicleBuilder.BuildUpsertVehicle(); var race = RaceBuilder.BuildWithoutVehicles().AddVehicle(vehicleToAdd); race.Vehicles.Should().NotBeEmpty(); race.Vehicles.First().Should().BeEquivalentTo(vehicleToAdd); }