Ignore:
Timestamp:
Jun 7, 2010, 9:20:00 AM (12 years ago)
Author:
roberth
Message:

Samples are now shown in the study overview page. Also some tests are added and the bootstrap is updated to show some sample fields with a template

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/dbnp/studycapturing/EventTests.groovy

    r496 r536  
    1212    }
    1313
    14     void testSomething() {
     14    void testBelongsToGroup() {
     15        def events = [];
     16        10.times {
     17            events[ it ] = new Event(
     18                id: it,
     19                startTime: 3600,
     20                endTime: 3800
     21            )
     22            println( 'Created event ' + it );
     23        }
     24        def evGroup1 = new EventGroup(
     25            name: 'group1',
     26            events: events[0..4]
     27        )
     28        def evGroup2 = new EventGroup(
     29            name: 'group2',
     30            events: events[3..6]
     31        )
     32
     33        Set<EventGroup> set1 = new HashSet<EventGroup>();
     34        Set<EventGroup> set2 = new HashSet<EventGroup>();
     35        Set<EventGroup> setBoth = new HashSet<EventGroup>();
     36        Set<EventGroup> setEmpty = new HashSet<EventGroup>();
     37        set1.add( evGroup1 );
     38        set2.add( evGroup2 );
     39        setBoth.add( evGroup1 );
     40        setBoth.add( evGroup2 );
     41
     42        assert events[0].belongsToGroup( set1 );
     43        assert events[3].belongsToGroup( set1 );
     44        assert !events[6].belongsToGroup( set1 );
     45
     46        assert events[3].belongsToGroup( set2 );
     47        assert events[6].belongsToGroup( set2 );
     48
     49        assert !events[0].belongsToGroup( setEmpty );
     50        assert !events[8].belongsToGroup( setEmpty );
     51
     52        assert events[0].belongsToGroup( setBoth );
     53        assert events[3].belongsToGroup( setBoth );
     54        assert events[6].belongsToGroup( setBoth );
     55
     56        assert !events[7].belongsToGroup( setBoth );
    1557
    1658    }
Note: See TracChangeset for help on using the changeset viewer.