Package samples.mockpolicy

Examples of samples.mockpolicy.SimpleClassWithADependency


@MockPolicy(MockPolicyInvocationHandlerExample.class)
public class MockPolicyWithInvocationHandlerTest {

  @Test
  public void mockPolicyWithInvocationHandlerWorks() throws Exception {
    final SimpleClassWithADependency tested = new SimpleClassWithADependency();
    Whitebox.setInternalState(tested, new ResultCalculator(0));

    assertEquals(1.0, tested.getResult(), 0.0);

    verifyAll();
  }
View Full Code Here


@MockPolicy(MockPolicyExpectationsExample.class)
public class MockPolicyWithExpectationsTest {

  @Test
  public void mockPolicyWithExpectationsWorks() throws Exception {
    final SimpleClassWithADependency tested = new SimpleClassWithADependency();
    Whitebox.setInternalState(tested, new ResultCalculator(5));
   
    assertEquals(2.0, tested.getResult(), 0.0);
   
    verifyAll();
  }
View Full Code Here

TOP

Related Classes of samples.mockpolicy.SimpleClassWithADependency

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.