4
4
import static org .codefx .libfx .nesting .testhelper .NestingAccess .getNestingValue ;
5
5
import static org .codefx .libfx .nesting .testhelper .NestingAccess .setNestingObservable ;
6
6
import static org .codefx .libfx .nesting .testhelper .NestingAccess .setNestingValue ;
7
+ import static org .junit .Assert .assertEquals ;
7
8
import static org .junit .Assert .assertFalse ;
8
9
import static org .junit .Assert .assertNotSame ;
9
10
import static org .junit .Assert .assertNull ;
10
- import static org .junit .Assert .assertSame ;
11
11
import static org .junit .Assert .assertTrue ;
12
12
import javafx .beans .property .Property ;
13
13
14
14
import org .codefx .libfx .nesting .Nesting ;
15
- import org .codefx .libfx .nesting .property .NestedProperty ;
16
15
import org .codefx .libfx .nesting .testhelper .NestingAccess ;
17
16
import org .junit .Before ;
18
17
import org .junit .Test ;
@@ -60,7 +59,7 @@ public void setUp() {
60
59
*/
61
60
@ Test
62
61
public void testInnerValueAfterConstruction () {
63
- assertSame (getNestingValue (nesting ), property .getValue ());
62
+ assertEquals (getNestingValue (nesting ), property .getValue ());
64
63
assertFalse (property .isInnerObservableNull ());
65
64
}
66
65
@@ -72,11 +71,11 @@ public void testChangingValue() {
72
71
T newValue = createNewValue ();
73
72
setNestingValue (nesting , newValue );
74
73
// assert that setting the value worked
75
- assertSame (newValue , getNestingValue (nesting ));
74
+ assertEquals (newValue , getNestingValue (nesting ));
76
75
77
76
// assert that nesting and property hold the new value
78
- assertSame (getNestingValue (nesting ), property .getValue ());
79
- assertSame (newValue , property .getValue ());
77
+ assertEquals (getNestingValue (nesting ), property .getValue ());
78
+ assertEquals (newValue , property .getValue ());
80
79
}
81
80
82
81
/**
@@ -104,11 +103,11 @@ public void testChangingObservable() {
104
103
P newObservable = createNewObservableWithValue (newValue );
105
104
setNestingObservable (nesting , newObservable );
106
105
// assert that setting the observable worked
107
- assertSame (newObservable , getNestingObservable (nesting ));
106
+ assertEquals (newObservable , getNestingObservable (nesting ));
108
107
109
108
// assert that nesting and property hold the new value
110
- assertSame (getNestingValue (nesting ), property .getValue ());
111
- assertSame (newValue , property .getValue ());
109
+ assertEquals (getNestingValue (nesting ), property .getValue ());
110
+ assertEquals (newValue , property .getValue ());
112
111
// assert that 'isInnerObservableNull' is still false
113
112
assertFalse (property .isInnerObservableNull ());
114
113
}
@@ -124,7 +123,7 @@ public void testChangingObservableToNull() {
124
123
assertNull (getNestingObservable (nesting ));
125
124
126
125
// assert that the nesting still holds the old value
127
- assertSame (oldValue , property .getValue ());
126
+ assertEquals (oldValue , property .getValue ());
128
127
// assert that 'isInnerObservableNull' is now true
129
128
assertTrue (property .isInnerObservableNull ());
130
129
}
@@ -138,15 +137,15 @@ public void testChangingNewObservablesValue() {
138
137
P newObservable = createNewObservableWithSomeValue ();
139
138
setNestingObservable (nesting , newObservable );
140
139
// (assert that setting the observable worked)
141
- assertSame (newObservable , getNestingObservable (nesting ));
140
+ assertEquals (newObservable , getNestingObservable (nesting ));
142
141
143
142
// ... and change its value
144
143
T newValue = createNewValue ();
145
144
newObservable .setValue (newValue );
146
145
147
146
// assert that nesting and property hold the new value
148
- assertSame (getNestingValue (nesting ), property .getValue ());
149
- assertSame (newValue , property .getValue ());
147
+ assertEquals (getNestingValue (nesting ), property .getValue ());
148
+ assertEquals (newValue , property .getValue ());
150
149
}
151
150
152
151
/**
@@ -171,8 +170,8 @@ public void testChangingOldObservablesValue() {
171
170
// assert that nesting and property do not hold the old observable's value ...
172
171
assertNotSame (newValueInOldObservable , property .getValue ());
173
172
// ... but the new one
174
- assertSame (getNestingValue (nesting ), property .getValue ());
175
- assertSame (newValueInNewObservable , property .getValue ());
173
+ assertEquals (getNestingValue (nesting ), property .getValue ());
174
+ assertEquals (newValueInNewObservable , property .getValue ());
176
175
}
177
176
178
177
//#end TESTS
0 commit comments