コード例 #1
0
  @Test(expected = UnexpectedInvocation.class)
  public void verifyAllInvocationsToInheritedMethods_whenNotVerified(final SubDependency mock2) {
    mock2.prepare();
    mock2.getValue();

    new FullVerifications(1, mock2) {
      {
        mock2.getValue();
      }
    };
  }
コード例 #2
0
  @Test(expected = UnexpectedInvocation.class)
  public void verifyAllInvocationsToMethodsOfBaseClassAndOfSubclass_whenInheritedMethodNotVerified(
      final SubDependency mock2) {
    mock2.prepare();
    mock2.getValue();

    new FullVerificationsInOrder(mock2) {
      {
        mock2.getValue();
      }
    };
  }
コード例 #3
0
  @Test
  public void verifyAllInvocationsToMethodsOfBaseClassAndOfSubclass(final SubDependency mock2) {
    mock2.prepare();
    mock2.getValue();

    new FullVerifications(mock2) {
      {
        mock2.prepare();
        mock2.getValue();
      }
    };
  }