Examples of DemoMuteQuack


Examples of com.visionarysoftwaresolutions.hfdpch1.tddstyle.demo.DemoMuteQuack

  @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

Examples of com.visionarysoftwaresolutions.hfdpch1.tddstyle.demo.DemoMuteQuack

  @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

Examples of com.visionarysoftwaresolutions.hfdpch1.tddstyle.demo.DemoMuteQuack

 
  @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
TOP
Copyright © 2018 www.massapi.com. 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.