summaryrefslogtreecommitdiff
path: root/app/src/test/java/de/blinkt/openvpn/core/connection/ConnectionTest.java
blob: 6313bc82cff63f2c0c01ef7190995679f961357c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package de.blinkt.openvpn.core.connection;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static de.blinkt.openvpn.core.connection.Connection.TransportType.OBFS4_HOP;

import org.junit.Test;

public class ConnectionTest {

    @Test
    public void TransportTypeTest_fromString() {
        Connection.TransportType transportType = Connection.TransportType.fromString("obfs4-hop");
        assertEquals(OBFS4_HOP, transportType);
    }

    @Test
    public void TransportTypeTest_toString() {
        assertEquals("obfs4-hop", OBFS4_HOP.toString());
    }

    @Test
    public void TransportTypeTest_valueOf() {
        Exception exception = null;
        try {
            Connection.TransportType.valueOf("obfs4-hop");
        } catch (IllegalArgumentException e) {
            exception = e;
        }
        assertNotNull(exception);
    }

}