static void print_02() { Car car = new Car(); Plane plane = new Plane(); FlyingCar flyingcar = new FlyingCar(); car.Run(); plane.Fly(); flyingcar.Run(); flyingcar.Fly(); }
public void ISPRightWayTest() { ITerrainableVehicle terrainableVehicle = new Car(); terrainableVehicle.Drive(); IFlightableVehicle flightableVehicle = new Airplane(); flightableVehicle.Fly(); IVersatileVehicle versatileVehicle = new FlyingCar(); versatileVehicle.Drive(); versatileVehicle.Fly(); }
static void Main(string[] args) { FlyingCar clsCar = new FlyingCar(); clsCar.Fly(); clsCar.Run(); IRunnable iRunable = clsCar as IRunnable; iRunable.Run(); IFlyable iFlyable = clsCar as IFlyable; iFlyable.Fly(); }
static void Main(string[] args) { FlyingCar car = new FlyingCar(); car.Run(); car.Fly(); IRunnable runnable = car as IRunnable; runnable.Run(); IFlyable flyable = car as IFlyable; flyable.Fly(); }
public void testFutures2() { ICsConfigurationBuilder cb = TangFactory.GetTang().NewConfigurationBuilder(); IInjector i = TangFactory.GetTang().NewInjector(cb.Build()); IInjector i2 = i.ForkInjector(new IConfiguration[] { }); FlyingCar c = (FlyingCar)i.GetInstance(typeof(FlyingCar)); Assert.IsTrue(c == c.getDriver().getMyCar()); Assert.IsTrue(c.getDriver() == c.getDriver().getMyCar().getDriver()); FlyingCar c2 = (FlyingCar)i2.GetInstance(typeof(FlyingCar)); Assert.IsTrue(c2 == c2.getDriver().getMyCar()); Assert.IsTrue(c2.getDriver() == c2.getDriver().getMyCar().getDriver()); Assert.IsTrue(c2 != c.getDriver().getMyCar()); Assert.IsTrue(c2.getDriver() != c.getDriver().getMyCar().getDriver()); }
static void Main(string[] args) { FlyingCar car = new FlyingCar(); car.Run(); car.Fly(); IRunnable runnable = car as IRunnable; runnable.Run(); IFlyable flyable = car as IFlyable; flyable.Fly(); car.Company = "Naver"; car.HorsePower = 12.4f; car.Year = 1234; WriteLine($"{car.Company} {car.HorsePower} {car.Year}"); }
public override FlyingCar getMyCar() { FlyingCar c = fCar.Get(); return(c); }
public virtual FlyingCar getMyCar() { FlyingCar c = fcar.Get(); return(c); }