01: package org.springunit.examples.tutorial;
02:
03: import org.springunit.examples.CompositeDateTime;
04: import org.springunit.examples.Range;
05: import org.springunit.framework.SpringUnitContext;
06: import org.springunit.framework.SpringUnitTest;
07:
08: public class RangeTutorialExample4Test extends SpringUnitTest {
09:
10: public void testIsWithinBelowLower() throws Exception {
11: runIsWithin();
12: }
13:
14: public void testIsWithinAtLower() throws Exception {
15: runIsWithin();
16: }
17:
18: public void testIsWithinBetween() throws Exception {
19: runIsWithin();
20: }
21:
22: public void testIsWithinAtUpper() throws Exception {
23: runIsWithin();
24: }
25:
26: public void testIsWithinAboveUpper() throws Exception {
27: runIsWithin();
28: }
29:
30: protected void runIsWithin() throws Exception {
31: Range<CompositeDateTime> subject = getObject("subject");
32: CompositeDateTime item = getObject("item");
33: boolean expected = getObject("expected");
34: boolean actual = subject.isWithin(item);
35: assertEquals(expected, actual);
36: }
37:
38: public SpringUnitContext getRangeTutorialExample4Test() {
39: return this .rangeTutorialExample4Test;
40: }
41:
42: public void setRangeTutorialExample4Test(
43: SpringUnitContext rangeTutorialExample4Test) {
44: this .rangeTutorialExample4Test = rangeTutorialExample4Test;
45: }
46:
47: private SpringUnitContext rangeTutorialExample4Test;
48:
49: }
|