jeudi 27 juin 2019

How to test class with return new object of this class

Here is code:

MyClass myMethod(String string){
    String x = string.substring...// body is not important here
    return new MyClass(x);
}

This code works as intended. I have created some test (based on various assertions), all passed (shows in green, but I'm wondering if I really test it). Unfortunately, all of these tests not shown as "coverage" in JaCoCo report.

I have no idea what I doing wrong. I would like to "coverage" this method in JaCoCo.

Aucun commentaire:

Enregistrer un commentaire