source: trunk/test/unit/dbnp/studycapturing/TemplateTests.groovy @ 959

Last change on this file since 959 was 959, checked in by j.a.m.wesbeek@…, 9 years ago
  • set keyword expansion
  • Property svn:keywords set to Author Date Rev
File size: 767 bytes
Line 
1package dbnp.studycapturing
2
3import grails.test.*
4
5class TemplateTests extends GrailsUnitTestCase {
6    protected void setUp() {
7        super.setUp()
8    }
9
10    protected void tearDown() {
11        super.tearDown()
12    }
13
14    void testInUse() {
15                Template t1 = new Template( entity: dbnp.studycapturing.Subject );
16                Template t2 = new Template( entity: dbnp.studycapturing.Subject );
17                Template t3 = new Template( entity: dbnp.studycapturing.Subject );
18
19                Subject s1 = new Subject( template: t1 );
20                Subject s2 = new Subject( template: t1 );
21                Subject s3 = new Subject( template: t2 );
22
23                mockDomain(Template, [t1, t2, t3 ])
24                mockDomain(Subject, [ s1, s2, s3] )
25
26                assert t1.inUse();
27                assert t2.inUse();
28                assert !t3.inUse();
29
30    }
31}
Note: See TracBrowser for help on using the repository browser.