How to do Junit in this method?

Asked

Viewed 8 times

-1

I’m learning Junit and I’m trying to test the toString method, but I can’t do it. I would like the help to understand where and how I should begin.
Follows code below

public String toString(){
        if(marcado) {
            return  "x";
        } else if (aberto && minado){
            return "*";
        } else if (aberto && minasNaVizinhanca() > 0){
            return Long.toString(minasNaVizinhanca());
        } else if (aberto) {
            return " ";
        } else {
            return "?";
        }
    }
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.