blob: e54e1cd418f5201f88a9bb55b5b1d93cdb0b1bc7 (
plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
package com.vaadin.tests.components.datefield;
import java.util.ArrayList;
import junit.framework.TestCase;
import com.vaadin.tests.util.TestUtil;
import com.vaadin.ui.DateField.Resolution;
public class ResolutionTest extends TestCase {
public void testResolutionHigherOrEqualToYear() {
Iterable<Resolution> higherOrEqual = Resolution
.getResolutionsHigherOrEqualTo(Resolution.YEAR);
ArrayList<Resolution> expected = new ArrayList<Resolution>();
expected.add(Resolution.YEAR);
TestUtil.assertIterableEquals(expected, higherOrEqual);
}
public void testResolutionHigherOrEqualToDay() {
Iterable<Resolution> higherOrEqual = Resolution
.getResolutionsHigherOrEqualTo(Resolution.DAY);
ArrayList<Resolution> expected = new ArrayList<Resolution>();
expected.add(Resolution.DAY);
expected.add(Resolution.MONTH);
expected.add(Resolution.YEAR);
TestUtil.assertIterableEquals(expected, higherOrEqual);
}
public void testResolutionLowerThanDay() {
Iterable<Resolution> higherOrEqual = Resolution
.getResolutionsLowerThan(Resolution.DAY);
ArrayList<Resolution> expected = new ArrayList<Resolution>();
expected.add(Resolution.HOUR);
expected.add(Resolution.MINUTE);
expected.add(Resolution.SECOND);
TestUtil.assertIterableEquals(expected, higherOrEqual);
}
public void testResolutionLowerThanSecond() {
Iterable<Resolution> higherOrEqual = Resolution
.getResolutionsLowerThan(Resolution.SECOND);
ArrayList<Resolution> expected = new ArrayList<Resolution>();
TestUtil.assertIterableEquals(expected, higherOrEqual);
}
public void testResolutionLowerThanYear() {
Iterable<Resolution> higherOrEqual = Resolution
.getResolutionsLowerThan(Resolution.YEAR);
ArrayList<Resolution> expected = new ArrayList<Resolution>();
expected.add(Resolution.MONTH);
expected.add(Resolution.DAY);
expected.add(Resolution.HOUR);
expected.add(Resolution.MINUTE);
expected.add(Resolution.SECOND);
TestUtil.assertIterableEquals(expected, higherOrEqual);
}
}
|