public void CreateSpecificTankThatDoesNotExist() { var vehicleFactory = new VehicleFactory(); IMilitaryVehicle tank = vehicleFactory.BuildTank(string.Empty); Assert.IsNull(tank); }
public void CreateSpecificTankThatExists() { var vehicleFactory = new VehicleFactory(); IMilitaryVehicle tank = vehicleFactory.BuildTank("churchill"); Assert.IsNotNull(tank as Churchill); }
public void UseOfSpecificAbstractFactoryToCreateWarplane() { Base ukBase = new UKBase(GermanFactorySet.Instance); IMilitaryVehicle tank = ukBase.BuildTank(); Assert.IsNotNull(tank as Tiger); }
public void UseOfDefaultAbstractFactoryToCreateWarplane() { Base ukBase = new UKBase(); //Default IFactorySet == UKFactorySet IMilitaryVehicle warplane = ukBase.BuildWarplane(); Assert.IsNotNull(warplane as Spitfire); }
public IMilitaryVehicle Build(string name) { IMilitaryVehicle vehicle = Create(name); if (vehicle == null) { return(null); } //vehicle.Shoot(); //vehicle.Reload(); //vehicle.Repair(); return(vehicle); }
public void CreateSpecificWarshipFromSpecificShipyardThatDoesNotExist() { IMilitaryVehicle warship = Shipyard.Instance.Build(string.Empty); Assert.IsNull(warship); }
public void CreateSpecificWarshipFromSpecificShipyardThatExists() { IMilitaryVehicle warship = Shipyard.Instance.Build("valkyrie"); Assert.IsNotNull(warship as Valkyrie); }