@@ -48,7 +48,7 @@ public async Task TestBuildConnectMessage()
4848 Assert . IsTrue ( message . ContainsKey ( "applicationId" ) ) ;
4949 Assert . IsTrue ( message . ContainsKey ( "windowsKey" ) ) ;
5050 Assert . IsTrue ( message . ContainsKey ( "sessionToken" ) ) ;
51- Assert . HasCount ( 4 , message ) ;
51+ Assert . AreEqual ( 4 , message . Count ) ;
5252 Assert . AreEqual ( "connect" , message [ "op" ] ) ;
5353 Assert . AreEqual ( Client . Services . LiveQueryServerConnectionData . ApplicationID , message [ "applicationId" ] ) ;
5454 Assert . AreEqual ( Client . Services . LiveQueryServerConnectionData . Key , message [ "windowsKey" ] ) ;
@@ -65,17 +65,17 @@ public void TestBuildUnsubscribeMessage()
6565 Assert . IsNotNull ( message ) ;
6666 Assert . IsTrue ( message . ContainsKey ( "op" ) ) ;
6767 Assert . IsTrue ( message . ContainsKey ( "requestId" ) ) ;
68- Assert . HasCount ( 2 , message ) ;
68+ Assert . AreEqual ( 2 , message . Count ) ;
6969 Assert . AreEqual ( "unsubscribe" , message [ "op" ] ) ;
7070 Assert . AreEqual ( requestId , message [ "requestId" ] ) ;
7171
72- Assert . ThrowsExactly < ArgumentOutOfRangeException > ( ( ) => builder . BuildUnsubscribeMessage ( 0 ) ) ;
72+ Assert . ThrowsException < ArgumentOutOfRangeException > ( ( ) => builder . BuildUnsubscribeMessage ( 0 ) ) ;
7373 }
7474
7575 private void ValidateSubscriptionMessage ( IDictionary < string , object > message , string expectedOp , int requestId )
7676 {
7777 Assert . IsNotNull ( message ) ;
78- Assert . HasCount ( 4 , message ) ;
78+ Assert . AreEqual ( 4 , message . Count ) ;
7979
8080 Assert . IsTrue ( message . ContainsKey ( "op" ) ) ;
8181 Assert . AreEqual ( expectedOp , message [ "op" ] ) ;
@@ -84,28 +84,28 @@ private void ValidateSubscriptionMessage(IDictionary<string, object> message, st
8484 Assert . AreEqual ( requestId , message [ "requestId" ] ) ;
8585
8686 Assert . IsTrue ( message . ContainsKey ( "query" ) ) ;
87- Assert . IsInstanceOfType < IDictionary < string , object > > ( message [ "query" ] , "The 'query' value should be a Dictionary<string, object>." ) ;
88- Assert . HasCount ( 4 , ( IDictionary < string , object > ) message [ "query" ] ) ;
87+ Assert . IsInstanceOfType ( message [ "query" ] , typeof ( IDictionary < string , object > ) , "The 'query' value should be a Dictionary<string, object>." ) ;
88+ Assert . AreEqual ( 4 , ( ( IDictionary < string , object > ) message [ "query" ] ) . Count ) ;
8989 IDictionary < string , object > query = message [ "query" ] as IDictionary < string , object > ;
9090
9191 Assert . IsTrue ( query . ContainsKey ( "className" ) , "The 'query' dictionary should contain the 'className' key." ) ;
9292 Assert . AreEqual ( "DummyClass" , query [ "className" ] , "The 'className' property should be 'DummyClass'." ) ;
9393
9494 Assert . IsTrue ( query . ContainsKey ( "where" ) , "The 'query' dictionary should contain the 'where' key." ) ;
95- Assert . IsInstanceOfType < IDictionary < string , object > > ( query [ "where" ] , "The 'where' property should be a Dictionary<string, object>." ) ;
95+ Assert . IsInstanceOfType ( query [ "where" ] , typeof ( IDictionary < string , object > ) , "The 'where' property should be a Dictionary<string, object>." ) ;
9696 IDictionary < string , object > where = ( IDictionary < string , object > ) query [ "where" ] ;
97- Assert . HasCount ( 1 , where , "The 'where' dictionary should contain exactly one key-value pair." ) ;
97+ Assert . AreEqual ( 1 , where . Count , "The 'where' dictionary should contain exactly one key-value pair." ) ;
9898 Assert . IsTrue ( where . ContainsKey ( "foo" ) , "The 'where' dictionary should contain the 'foo' key." ) ;
9999 Assert . AreEqual ( "bar" , where [ "foo" ] , "The 'foo' property in 'where' should be 'bar'." ) ;
100100
101101 Assert . IsTrue ( query . ContainsKey ( "keys" ) , "The 'query' dictionary should contain the 'keys' key." ) ;
102- Assert . IsInstanceOfType < string [ ] > ( query [ "keys" ] , "The 'keys' property should be a string array." ) ;
103- Assert . HasCount ( 1 , ( string [ ] ) query [ "keys" ] , "The 'keys' array should contain exactly one element." ) ;
102+ Assert . IsInstanceOfType ( query [ "keys" ] , typeof ( string [ ] ) , "The 'keys' property should be a string array." ) ;
103+ Assert . AreEqual ( 1 , ( ( string [ ] ) query [ "keys" ] ) . Length , "The 'keys' array should contain exactly one element." ) ;
104104 Assert . AreEqual ( "foo" , ( ( string [ ] ) query [ "keys" ] ) [ 0 ] , "The 'keys' parameter should contain 'foo'." ) ;
105105
106106 Assert . IsTrue ( query . ContainsKey ( "watch" ) , "The 'query' dictionary should contain the 'watch' key." ) ;
107- Assert . IsInstanceOfType < string [ ] > ( query [ "watch" ] , "The 'watch' property should be a string array." ) ;
108- Assert . HasCount ( 1 , ( string [ ] ) query [ "watch" ] , "The 'watch' array should contain exactly one element." ) ;
107+ Assert . IsInstanceOfType ( query [ "watch" ] , typeof ( string [ ] ) , "The 'watch' property should be a string array." ) ;
108+ Assert . AreEqual ( 1 , ( ( string [ ] ) query [ "watch" ] ) . Length , "The 'watch' array should contain exactly one element." ) ;
109109 Assert . AreEqual ( "foo" , ( ( string [ ] ) query [ "watch" ] ) [ 0 ] , "The 'watch' parameter should contain 'foo'." ) ;
110110
111111 }
@@ -118,15 +118,15 @@ public async Task TestBuildSubscribeMessage()
118118 Client . Services ,
119119 "DummyClass" ,
120120 new Dictionary < string , object > { { "foo" , "bar" } } ,
121- [ "foo" ] ,
122- [ "foo" ] ) ;
121+ new [ ] { "foo" } ,
122+ new [ ] { "foo" } ) ;
123123 ParseLiveQueryMessageBuilder builder = new ParseLiveQueryMessageBuilder ( ) ;
124124 IDictionary < string , object > message = await builder . BuildSubscribeMessage < ParseObject > ( requestId , liveQuery ) ;
125125
126126 ValidateSubscriptionMessage ( message , "subscribe" , requestId ) ;
127127
128- await Assert . ThrowsExactlyAsync < ArgumentOutOfRangeException > ( async ( ) => await builder . BuildSubscribeMessage < ParseObject > ( 0 , liveQuery ) ) ;
129- await Assert . ThrowsExactlyAsync < ArgumentNullException > ( async ( ) => await builder . BuildSubscribeMessage < ParseObject > ( requestId , null ) ) ;
128+ await Assert . ThrowsExceptionAsync < ArgumentOutOfRangeException > ( async ( ) => await builder . BuildSubscribeMessage < ParseObject > ( 0 , liveQuery ) ) ;
129+ await Assert . ThrowsExceptionAsync < ArgumentNullException > ( async ( ) => await builder . BuildSubscribeMessage < ParseObject > ( requestId , null ) ) ;
130130 }
131131
132132 [ TestMethod ]
@@ -137,14 +137,14 @@ public async Task TestBuildUpdateSubscriptionMessage()
137137 Client . Services ,
138138 "DummyClass" ,
139139 new Dictionary < string , object > { { "foo" , "bar" } } ,
140- [ "foo" ] ,
141- [ "foo" ] ) ;
140+ new [ ] { "foo" } ,
141+ new [ ] { "foo" } ) ;
142142 ParseLiveQueryMessageBuilder builder = new ParseLiveQueryMessageBuilder ( ) ;
143143 IDictionary < string , object > message = await builder . BuildUpdateSubscriptionMessage < ParseObject > ( requestId , liveQuery ) ;
144144
145145 ValidateSubscriptionMessage ( message , "update" , requestId ) ;
146146
147- await Assert . ThrowsExactlyAsync < ArgumentOutOfRangeException > ( async ( ) => await builder . BuildUpdateSubscriptionMessage < ParseObject > ( 0 , liveQuery ) ) ;
148- await Assert . ThrowsExactlyAsync < ArgumentNullException > ( async ( ) => await builder . BuildUpdateSubscriptionMessage < ParseObject > ( requestId , null ) ) ;
147+ await Assert . ThrowsExceptionAsync < ArgumentOutOfRangeException > ( async ( ) => await builder . BuildUpdateSubscriptionMessage < ParseObject > ( 0 , liveQuery ) ) ;
148+ await Assert . ThrowsExceptionAsync < ArgumentNullException > ( async ( ) => await builder . BuildUpdateSubscriptionMessage < ParseObject > ( requestId , null ) ) ;
149149 }
150150}
0 commit comments