Package samples.expectvoid

Examples of samples.expectvoid.ExpectVoidDemo


public class ExpectVoidDemoTest {

  @Test
  public void testInvokeAPrivateVoidMethod() throws Exception {
    final String methodToMock = "privateInvoke";
    ExpectVoidDemo tested = createPartialMock(ExpectVoidDemo.class, methodToMock);

    final int expected = 112;

    expectPrivate(tested, methodToMock, expected).times(1);

    replay(tested);

    tested.invokeAPrivateVoidMethod(expected);

    verify(tested);
  }
View Full Code Here


  @Test
  public void testInvokeAPrivateVoidMethod_usingPowerMockExpectLastCall()
      throws Exception {
    final String methodToMock = "privateInvoke";
    ExpectVoidDemo tested = createPartialMock(ExpectVoidDemo.class, methodToMock);

    final int expected = 112;

    Whitebox.invokeMethod(tested, methodToMock, expected);
    expectLastCall().times(1);

    replay(tested);

    tested.invokeAPrivateVoidMethod(expected);

    verify(tested);
  }
View Full Code Here

  @Test
  public void testInvokeAPrivateVoidMethod_usingEasyMockExpectLastCall()
      throws Exception {
    final String methodToMock = "privateInvoke";
    ExpectVoidDemo tested = createPartialMock(ExpectVoidDemo.class, methodToMock);

    final int expected = 112;

    Whitebox.invokeMethod(tested, methodToMock, expected);
    EasyMock.expectLastCall();

    replay(tested);

    tested.invokeAPrivateVoidMethod(expected);

    verify(tested);
  }
View Full Code Here

TOP

Related Classes of samples.expectvoid.ExpectVoidDemo

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.