mercredi 17 février 2021

Testing a method that calls other methods based on condition

I have a method that calls another methods based on conditions as shown below. The method

public class Class1 {
    public List<Object> someMethod(String str1, String str2, String str3){
       if(str1.isEmpty())
          anotherMethod1Call();
       elseif (someother condition)
           anotherMethod2Call();
      and some more elseif statements
    }
}

How can I test this method using @ParameterizedTest

Aucun commentaire:

Enregistrer un commentaire