1/*
2 * Copyright 2012 AndroidPlot.com
3 *
4 *    Licensed under the Apache License, Version 2.0 (the "License");
5 *    you may not use this file except in compliance with the License.
6 *    You may obtain a copy of the License at
7 *
8 *        http://www.apache.org/licenses/LICENSE-2.0
9 *
10 *    Unless required by applicable law or agreed to in writing, software
11 *    distributed under the License is distributed on an "AS IS" BASIS,
12 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 *    See the License for the specific language governing permissions and
14 *    limitations under the License.
15 */
16
17package com.androidplot;
18
19import org.junit.After;
20import org.junit.Before;
21import org.junit.Test;
22
23import static org.junit.Assert.assertFalse;
24import static org.junit.Assert.assertTrue;
25
26public class RegionTest {
27    @Before
28    public void setUp() throws Exception {
29
30    }
31
32    @After
33    public void tearDown() throws Exception {
34
35    }
36
37    @Test
38    public void testContains() throws Exception {
39
40    }
41
42    @Test
43    public void testIntersects() throws Exception {
44        LineRegion line1 = new LineRegion(1, 10);
45        LineRegion line2 = new LineRegion(11, 20);
46        assertFalse(line1.intersects(line2));
47
48        line1.setMaxVal(15);
49        assertTrue(line1.intersects(line2));
50
51        //l1end = 30;
52        line1.setMaxVal(30);
53        assertTrue(line1.intersects(line2));
54
55        //l1start = 21;
56        line1.setMinVal(21);
57        assertFalse(line1.intersects(line2));
58    }
59}
60