Package com.visionarysoftwaresolutions.hfdpch1.tddstyle.ducks

Examples of com.visionarysoftwaresolutions.hfdpch1.tddstyle.ducks.CyborgDuck


  @Test
  public void testCustomQuackBehavior(){
    //Given: A Redhead duck
    //And: I want to change the quacking behavior at runtime from its default
    //When: The quacking behavior is changed
    redheadDuck.setQuackBehavior(new DemoMuteQuack());
    //And: The Redhead duck is asked to quack
    //Then: It should demonstrate the new correct quacking behavior
    String expected = "...Really? I can't quack. Oddly I do seem to do Englsih pretty well.";
    assertTrue(DuckTester.quackBehavior(redheadDuck, expected));
  }
View Full Code Here


  @Test
  public void testCustomQuackBehavior(){
    //Given: A Rubber duck
    //And: I want to change the quacking behavior at runtime from its default
    //When: The quacking behavior is changed
    rubberDucky.setQuackBehavior(new DemoMuteQuack());
    //And: The Rubber duck is asked to quack
    //Then: It should demonstrate the new correct quacking behavior
    String expected = "...Really? I can't quack. Oddly I do seem to do Englsih pretty well.";
    assertTrue(DuckTester.quackBehavior(rubberDucky, expected));
  }
View Full Code Here

 
  @Test
  public void testCorrectQuack() {
    //Given: You have a quack behavior
    //When: It is set to MuteQuack
    QuackBehavior quackbehavior = new DemoMuteQuack();
    //Then: The quack behavior should demonstrate the correct quacking
    String expected = "...Really? I can't quack. Oddly I do seem to do Englsih pretty well.";
    assertEquals(expected, quackbehavior.quack());
  }
View Full Code Here

import com.visionarysoftwaresolutions.hfdpch1.tddstyle.ducks.CyborgDuck;

public class CyborgDuckFunctions {

  public void allCyborgDuckFunctions(){
    CyborgDuck demoCyborgDuck = new CyborgDuck();
    System.out.println("--CyborgDuck Functions--");
    SharedFunctions.displayFunction(demoCyborgDuck);
    SharedFunctions.swimFunction(demoCyborgDuck);
    SharedFunctions.quackFunction(demoCyborgDuck);
    SharedFunctions.flyFunction(demoCyborgDuck);
View Full Code Here

 
  private Duck cyborgDuck;
     
  @Before
  public void setup(){
      cyborgDuck = new CyborgDuck();
   }
View Full Code Here

 
  private Duck mallard;
     
  @Before
  public void setup(){
      mallard = new MallardDuck();
   }
View Full Code Here

 
  private Duck modelDuck;
     
  @Before
  public void setup(){
      modelDuck = new ModelDuck();
   }
View Full Code Here

 
  private Duck redheadDuck;
     
  @Before
  public void setup(){
      redheadDuck = new RedheadDuck();
   }
View Full Code Here

 
  private Duck rubberDucky;
     
  @Before
  public void setup(){
      rubberDucky = new RubberDuck();
   }
View Full Code Here

import com.visionarysoftwaresolutions.hfdpch1.tddstyle.quacks.Squeak;

public class RubberDuck extends Duck{
 
  public RubberDuck(){
    flyBehavior = new FlyNoWay();
    quackBehavior = new Squeak();
  }
View Full Code Here

TOP

Related Classes of com.visionarysoftwaresolutions.hfdpch1.tddstyle.ducks.CyborgDuck

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.