samedi 11 août 2018

How to create method with parameter in Mockito Tool

I am learning mockito, So I am new to a Mockito tool. Can make mockito method parameterised?

eg. 
I am having one class (**ABC.java**) where I have few methods with @Test annotations.
like @Test
      public void addition()
      {
      }

And I am invoking them through another Test class (**testClass.java**).
like. 
Result result = JUnitCore.runClasses(**ABC.class**);
      for (Failure failure : result.getFailures()) {
         System.out.println(failure.toString());
      }

      System.out.println(result.wasSuccessful());

So I want to invoke an addition method with a parameter from the test class(**testClass.java**).

Aucun commentaire:

Enregistrer un commentaire