Esempio n. 1
0
        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.");
        }
Esempio n. 2
0
        public void AddVehicleToTheRace()
        {
            var vehicleToAdd = VehicleBuilder.BuildUpsertVehicle();

            var race = RaceBuilder.BuildWithoutVehicles().AddVehicle(vehicleToAdd);

            race.Vehicles.Should().NotBeEmpty();
            race.Vehicles.First().Should().BeEquivalentTo(vehicleToAdd);
        }