public void Display() { Duck duck = new Duck("Утьоночек", 3, 5, true); string str = duck.Display(); Assert.Equal("Уточки - милые создания", str); }
private static void PerformDuckFunctions(Duck duck) { duck.Display(); duck.PerformQuack(); duck.PerformSwim(); duck.PerformFly(); Console.WriteLine(); }
public void Display_GivesString() { IFlyStrategy f = new Flap(); IQuackStrategy q = new OneBigQuack(); Duck d = new Duck(f, q); var actual = d.Display(); Assert.IsType <String>(actual); }
public void Duck_IsModular() { string expected = "Glide quackquackquack"; IFlyStrategy f = new Glide(); IQuackStrategy q = new ManyTinyQuacks(); Duck d = new Duck(f, q); string actual = d.Display(); Assert.Equal(expected, actual); }
public void Duck_Composes() { string expected = "Flap Quack"; IFlyStrategy f = new TestFlyStrategy(); IQuackStrategy q = new TestQuackStrategy(); Duck d = new Duck(f, q); string actual = d.Display(); Assert.Equal(expected, actual); }
private static void SimulateDuck(Duck duck) { if (duck == null) { return; } Console.WriteLine(duck.GetType().Name); duck.Dance(); duck.Display(); duck.Fly(); duck.Quack(); duck.Swim(); Console.WriteLine(); }
static void PerformActions(Duck duck) { Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); Console.WriteLine("Type to make duck perform some action:"); Console.WriteLine("1 for display"); Console.WriteLine("2 for make it fly"); Console.WriteLine("3 for make it Swim"); Console.WriteLine("4 for make it Quack"); Console.WriteLine("0 to go Back"); while (true) { int.TryParse(Console.ReadLine(), out int perform); switch (perform) { case 0: RunDuckApp(); return; case 1: duck.Display(); break; case 2: duck.performFly(); break; case 3: duck.Swim(); break; case 4: duck.performQuack(); break; default: break; } } }
public void Display() { Assert.AreEqual(DuckMessages.ModelDisplay, duck.Display()); }
static void DrawDuck(Duck duck) { duck.Display(); }
private static void TestDuck(Duck duck) { duck.Display(); duck.Quack(); duck.Fly(); }
public void Display() { Assert.AreEqual(DuckMessages.RubberDisplay, duck.Display()); }
private void btnDisplay_Click(object sender, EventArgs e) { CheckDuckType(); lblMessage.Text = _duck.Display(); }
static void PrintMsg(Duck duck) { sb.Append(duck.Display()); sb.Append(duck.PerformFly()); sb.Append(duck.PerformQuack()); }
private void btnDisplay_Click(object sender, EventArgs e) { lblDisplay.Text = _duck.Display(); }
private void Display_Click(object sender, EventArgs e) { CheckDuckType(); lblDisplay.Text = _duck.Display(); }