mercredi 15 février 2017

Using if-else statement inside Groovy - spock test

Currently when I use if else in a Groovy - spock when:, only the if is executed and the else is not. Is there any other way of implementing if-else inside spock tests? I tried switch case and encountered the same.

     if (value == 'x' || 'y' || 'y')
    {
        //execute below info
    }

    else if (value == 'z'){
        //execute below info
    }

Aucun commentaire:

Enregistrer un commentaire