public void should_throw_no_matching_vehicle_cost_withdrawal_strategy_exception() { //Arrange var strategies = new List <VehicleCostCalculationStrategy>() { //new CarCostCalculationStrategy() }; var factory = new VehicleCostWithdrawalStrategyFactory(strategies); //Act var action = new Action(() => { factory.Create(new Car(new Guid(), new Driver(), "license")); }); //Assert action.Should().Throw <NoMatchingVehicleCostWithdrawalStrategyException>(); }
public void should_return_a_function_that_uses_the_matching_strategy() { //Arrange var expectedAmount = 1234; var strategies = new List <VehicleCostCalculationStrategy>() { new BusCostCalculationStrategy(), new FakeCarStrategy(expectedAmount), new HelicopterCostCalculationStrategy() }; var factory = new VehicleCostWithdrawalStrategyFactory(strategies); //Act var vehicle = new Car(new Guid(), new Driver(), "license"); var strategy = factory.Create(vehicle); //Assert strategy(vehicle, 1).Should().Be(expectedAmount); }