@@ -73,10 +73,28 @@ public void ListenReplace() {
73
73
}
74
74
} ) ;
75
75
76
- container . Set ( new IndexedDictionary < string , object > ( newData ) ) ;
76
+ container . Set ( newData ) ;
77
77
Assert . AreEqual ( 2 , listenCalls ) ;
78
78
}
79
79
80
+ [ Test ]
81
+ public void ListenWithoutPlaceholder ( ) {
82
+ var newData = GetRawData ( ) ;
83
+
84
+ var game = ( IndexedDictionary < string , object > ) newData [ "game" ] ;
85
+ game [ "turn" ] = 1 ;
86
+
87
+ var listenCalls = 0 ;
88
+ container . Listen ( "game/turn" , ( DataChange change ) => {
89
+ listenCalls ++ ;
90
+ Assert . AreEqual ( change . operation , "replace" ) ;
91
+ Assert . AreEqual ( change . value , 1 ) ;
92
+ } ) ;
93
+
94
+ container . Set ( newData ) ;
95
+ Assert . AreEqual ( 1 , listenCalls ) ;
96
+ }
97
+
80
98
[ Test ]
81
99
public void ListenAddArray ( ) {
82
100
var newData = GetRawData ( ) ;
@@ -130,6 +148,9 @@ protected IndexedDictionary<string, object> GetRawData () {
130
148
} ) }
131
149
} ) ) ;
132
150
151
+ data . Add ( "game" , new IndexedDictionary < string , object > ( new Dictionary < string , object > {
152
+ { "turn" , 0 }
153
+ } ) ) ;
133
154
data . Add ( "players" , players ) ;
134
155
data . Add ( "messages" , new List < object > { "one" , "two" , "three" } ) ;
135
156
return data ;
0 commit comments