1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-10 21:24:12 +01:00
Arduino/app/test/cc/arduino/net/PACSupportMethodsTest.java
2015-08-21 08:41:50 +02:00

29 lines
973 B
Java

package cc.arduino.net;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class PACSupportMethodsTest {
private PACSupportMethods pacSupportMethods;
@Before
public void setUp() throws Exception {
pacSupportMethods = new PACSupportMethods();
}
@Test
public void testIsInNet() throws Exception {
assertFalse(pacSupportMethods.isInNet("192.168.0.121", "198.95.249.79", "255.255.255.255"));
assertFalse(pacSupportMethods.isInNet("198.95.249.78", "198.95.249.79", "255.255.255.255"));
assertTrue(pacSupportMethods.isInNet("198.95.249.79", "198.95.249.79", "255.255.255.255"));
assertFalse(pacSupportMethods.isInNet("192.168.0.121", "198.95.0.0", "255.255.0.0"));
assertTrue(pacSupportMethods.isInNet("198.95.249.78", "198.95.0.0", "255.255.0.0"));
assertTrue(pacSupportMethods.isInNet("198.95.249.79", "198.95.0.0", "255.255.0.0"));
}
}