public static bool CreatePegicorn() { Console.ForegroundColor = ConsoleColor.Magenta; try { Console.WriteLine("Name the Zoo's Pegacorn:"); string name = Console.ReadLine(); Console.WriteLine("What is the pegacorn's super power?"); string superPower = Console.ReadLine(); Pegacorn pegacorn = new Pegacorn(superPower, name); int speed = pegacorn.FlightSpeed(); bool attack = pegacorn.Attack(); bool heal = pegacorn.Heal(); Console.ReadKey(); return(true); } catch (Exception ex) { Console.WriteLine($"Pegicorn - Exception thrown: {ex.Message}"); return(false); } }
public void PegacornInterface() { string superPower = "Speed flight"; // string superPower2 = "healer"; string name = "aldo"; Pegacorn pega = new Pegacorn(superPower, name); Assert.IsAssignableFrom <IFly>(pega); }
// Checking to see if Override works, pegacorn will have a specific attack public void PegacornOverrideAttack() { string superPower = "Speed flight"; // string superPower2 = "healer"; string name = "aldo"; Pegacorn pega = new Pegacorn(superPower, name); pega.Attack(); Assert.Equal(pega.Attack(), pega.Attack()); Assert.IsAssignableFrom <IFly>(pega); }
// Checking to see if Override works, pegacorn will have a specific name public void PegacornOverrideName() { string superPower = "Speed flight"; // string superPower2 = "healer"; string name = "aldo"; Pegacorn pega = new Pegacorn(superPower, name); // Pegacorn Override Name to change name Assert.Equal("aldo", "aldo"); Assert.IsAssignableFrom <IFly>(pega); }