private static void DoAbstractFactory() { AnimalWorld animalWorld = new AnimalWorld(new EuropaContinent()); animalWorld.ExecuteFoodChain(); Console.ReadKey(); }
public void FirstTest() { ContinentFactory africa = new AfricaFactory(); var world = new AnimalWorld(africa); world.RunFoodChain(); ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); }
static void Main(string[] args) { ContinentFactory myContinentFactory = new AfricaFactory(); AnimalWorld myAnimalWorld = new AnimalWorld(myContinentFactory); myAnimalWorld.RunFoodChain(); myContinentFactory = new AmericaFactory(); myAnimalWorld = new AnimalWorld(myContinentFactory); myAnimalWorld.RunFoodChain(); }
static void Main(string[] args) { AnimalWorld world = new AnimalWorld(new AfricaFactory()); world.RunFoodChain(); Console.WriteLine("==================="); world = new AnimalWorld(new AmericaFactory()); world.RunFoodChain(); Console.ReadKey(); }
public void Execute() { ContinentFactory afrika = new AfricaFactory(); AnimalWorld world = new AnimalWorld(afrika); world.RunFoodChain(); ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); }
public static void TestContinentFactory() { ContinentFactory africa = new AfricaFactory(); var world = new AnimalWorld(africa); StringAssert.AreEqualIgnoringCase("Lion eats Wildebeest", world.RunFoodChain(true)); ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); StringAssert.AreEqualIgnoringCase("Wolf eats Bison", world.RunFoodChain(true)); }
public static void RunRealWorldExample() { ContinentFactory americanFactory = new AmericanFactory(); var americanAnimalWorld = new AnimalWorld(americanFactory); americanAnimalWorld.DescribeAnimalBehavior(); ContinentFactory asianFactory = new AsianFactory(); var asianAnimalWorld = new AnimalWorld(asianFactory); asianAnimalWorld.DescribeAnimalBehavior(); }
public void AbstractFactoryTest() { ContinentFactory africa = new AfricaFactory(); AnimalWorld world = new AnimalWorld(africa); Assert.IsTrue(world.RunFoodChain() == "Lion eats Wildebeast"); ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); Assert.IsTrue(world.RunFoodChain() == "Wolf eats Bison"); }
private static void AbstractFactoryDemo() { var africa = new AfricaFactory(); var world = new AnimalWorld(africa); world.RunFoodChain(); var america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); }
/// <summary> /// Entry point into console application. /// </summary> public void Run() { // Create and run the African animal world var africa = new AfricaFactory(); var world = new AnimalWorld(africa); world.RunFoodChain(); // Create and run the American animal world var america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); }
// Entry point into console application. public static void Main() { // Create and run the African animal world continent = new AfricaFactory(); fauna = new AnimalWorld(continent); fauna.RunFoodChain(); // Create and run the American animal world continent = new AmericaFactory(); fauna = new AnimalWorld(continent); fauna.RunFoodChain(); // Wait for user input Console.ReadKey(); }
public static void Main(string[] args) { //Create and run the African animal world ContinentFactory africa = new AfricaFactory(); AnimalWorld world = new AnimalWorld(africa); world.RunFoodChain(); // Create and run the American animal world ContinentFactory amercia = new AmericaFactory(); world = new AnimalWorld(amercia); world.RunFoodChain(); //wait for user input before closing application Console.ReadKey(true); }
private static void TestFactory() { Console.WriteLine("Testing factory..."); // Create and run the African animal world ContinentFactory africa = new AfricaFactory(); var world = new AnimalWorld(africa); world.RunFoodChain(); // Create and run the American animal world ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); }
public void MainTest() { // TODO ContinentFactory africa = new AfricaFactory(); AnimalWorld world = new AnimalWorld(africa); world.RunFoodChain(); ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); Assert.AreEqual(1, 1); }
public static void Main(string[] args) { ForegroundColor = ConsoleColor.Cyan; const string dateTimeFormat = @"MM / dd / yyyy HH: mm: ss.fff"; var len = 2; var d = 9; WriteLine($"{(((len%9)*(d%9))%9)}"); WriteLine("Start -> {0}\n", DateTime.Now.ToString(dateTimeFormat, CultureInfo.InvariantCulture)); var africaAnimals = new AnimalWorld<AfricanAminals>(); africaAnimals.RunFoodChain(); var americalAnimals = new AnimalWorld<AmericanAnimals>(); americalAnimals.RunFoodChain(); WriteLine("\nEnd -> {0}", DateTime.Now.ToString(dateTimeFormat, CultureInfo.InvariantCulture)); WriteLine("\n\nPress any key ...."); ReadKey(); }
public static void Main( string[] args ) { // Create and run the Africa animal world ContinentFactory africa = new AfricaFactory(); AnimalWorld world = new AnimalWorld( africa ); world.RunFoodChain(); // Create and run the America animal world ContinentFactory america = new AmericaFactory(); world = new AnimalWorld( america ); world.RunFoodChain(); Console.Read(); }
public static void RunMain() { ContinentFactory americanFactory = new AmericanAnimalFactory(); ContinentFactory africanFactory = new AfricanAnimalFactory(); AnimalWorld world = new AnimalWorld(americanFactory); world.Run(); AnimalWorld world1 = new AnimalWorld(africanFactory); world1.Run(); }