File: TSourceListCategory.java

package info (click to toggle)
mac-widgets 0.10.0%2Bsvn416-dfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,968 kB
  • ctags: 2,003
  • sloc: java: 9,909; makefile: 13; sh: 12
file content (38 lines) | stat: -rw-r--r-- 1,223 bytes parent folder | download | duplicates (5)
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
34
35
36
37
38
package com.explodingpixels.macwidgets;

import org.junit.Test;
import org.junit.Assert;

public class TSourceListCategory {

    @Test
    public void testContains() {
        SourceListCategory category = new SourceListCategory("Category");
        SourceListItem item = new SourceListItem("Item");
        category.addItem(item);
        Assert.assertTrue("The category should contain the given item.",
                category.containsItem(item));
    }

    @Test
    public void testNotContains() {
        SourceListCategory category = new SourceListCategory("Category");
        SourceListItem item = new SourceListItem("Item");
        Assert.assertFalse("The category should not contain the given item.",
                category.containsItem(item));
    }

    @Test
    public void testContainsNested() {
        SourceListCategory category = new SourceListCategory("Category");
        SourceListItem itemOne = new SourceListItem("Item One");
        SourceListItem itemTwo = new SourceListItem("Item Two");

        category.addItem(itemOne);
        itemOne.addItem(itemTwo);

        Assert.assertTrue("The category should contain the given item.",
                category.containsItem(itemTwo));
    }

}