0

I am very new to junit and java. kindly let me know how write the junit for this code.

void Abc(Objsect o) {
    Attr[] attrd= o.changeAttr();
    if (attrd.length > 0) {
        for (int i = 0; i < attrd.length; i++) {
            if (attrd[i].toString().contains(PropertyMessage.fsc_pra)) {
                ifModified = true;
            }
        }
    }
}
Maha
  • 15
  • 1
  • 7
  • You are not returning anything or changing Objsect o, so this function does nothing? Please consider reading [this](https://stackoverflow.com/questions/3258733/new-to-unit-testing-how-to-write-great-tests). – Frieder Jul 22 '19 at 06:07
  • Possible duplicate of [New to unit testing, how to write great tests?](https://stackoverflow.com/questions/3258733/new-to-unit-testing-how-to-write-great-tests) – Frieder Jul 22 '19 at 06:08
  • Objsect is a hashmap @Frieder – Maha Jul 22 '19 at 06:15

0 Answers0