Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.5 kB
2
Indexable
Never
import static org.junit.Assert.assertEquals;
import org.junit.Test;

public class YourClass {
    protected String getTermOwr(boolean isIVR, boolean isDirectCash, boolean isMonerisGoPortal) {
        if (isIVR || isDirectCash || isMonerisGoPortal) {
            return CreateLocale.OWN.getvalue();
        }
        return CreateLocale.RENT.getvalue();
    }
}

public class GetTermOwrTest {

    @Test
    public void testGetTermOwr_IVRSelected() {
        // arrange
        YourClass object = new YourClass();

        // act
        String result = object.getTermOwr(true, false, false);

        // assert
        assertEquals("OWN", result);
    }

    @Test
    public void testGetTermOwr_DirectCashSelected() {
        // arrange
        YourClass object = new YourClass();

        // act
        String result = object.getTermOwr(false, true, false);

        // assert
        assertEquals("OWN", result);
    }

    @Test
    public void testGetTermOwr_MonerisGoPortalSelected() {
        // arrange
        YourClass object = new YourClass();

        // act
        String result = object.getTermOwr(false, false, true);

        // assert
        assertEquals("OWN", result);
    }

    @Test
    public void testGetTermOwr_NoneSelected() {
        // arrange
        YourClass object = new YourClass();

        // act
        String result = object.getTermOwr(false, false, false);

        // assert
        assertEquals("RENT", result);
    }
}