1- using System ;
1+ using NUnit . Framework ;
2+ using System ;
23using System . Collections . Generic ;
34using System . Linq ;
4- using System . Reactive . Disposables ;
55using System . Reactive . Linq ;
66using System . Threading . Tasks ;
7- using NUnit . Framework ;
87using WampSharp . Core . Serialization ;
98using WampSharp . Tests . Wampv2 . TestHelpers . Integration ;
109using WampSharp . V2 ;
@@ -31,9 +30,9 @@ public async Task ProgressiveCallsCallerProgress()
3130
3231 callerChannel . RealmProxy . RpcCatalog . Invoke
3332 ( callback ,
34- new CallOptions ( ) { ReceiveProgress = true } ,
33+ new CallOptions ( ) { ReceiveProgress = true } ,
3534 MyOperation . ProcedureUri ,
36- new object [ ] { 10 } ) ;
35+ new object [ ] { 10 } ) ;
3736
3837 int ? result = await callback . Task ;
3938
@@ -110,11 +109,11 @@ public async Task ProgressiveCallsCalleeProxyProgress()
110109 List < int > results = new List < int > ( ) ;
111110 MyProgress < int > progress = new MyProgress < int > ( i => results . Add ( i ) ) ;
112111
113- int result = await proxy . LongOp ( 10 , progress ) ;
112+ string result = await proxy . LongOp ( 10 , progress ) ;
114113
115114 CollectionAssert . AreEquivalent ( Enumerable . Range ( 0 , 10 ) , results ) ;
116115
117- Assert . That ( result , Is . EqualTo ( 10 ) ) ;
116+ Assert . That ( result , Is . EqualTo ( "10" ) ) ;
118117 }
119118
120119 [ Test ]
@@ -133,7 +132,7 @@ public async Task ProgressiveCallsCalleeProxyObservable()
133132
134133 IObservable < int > proxyResult = proxy . LongOp ( 9 ) ; // it will emit one more than asked
135134
136- IEnumerable < int > results = proxyResult . ToEnumerable ( ) ;
135+ IEnumerable < int > results = proxyResult . ToEnumerable ( ) ;
137136
138137 CollectionAssert . AreEquivalent ( Enumerable . Range ( 0 , 10 ) , results ) ;
139138 }
@@ -147,7 +146,7 @@ public async Task ProgressiveCallsCalleeProxyObservableError()
147146 IWampChannel calleeChannel = dualChannel . CalleeChannel ;
148147 IWampChannel callerChannel = dualChannel . CallerChannel ;
149148
150- MyOperation myOperation = new MyOperation { EndWithError = true } ;
149+ MyOperation myOperation = new MyOperation { EndWithError = true } ;
151150
152151 await calleeChannel . RealmProxy . RpcCatalog . Register ( myOperation , new RegisterOptions ( ) ) ;
153152 ILongOpObservableService proxy = callerChannel . RealmProxy . Services . GetCalleeProxy < ILongOpObservableService > ( ) ;
@@ -176,16 +175,16 @@ public IWampCancellableInvocation Invoke<TMessage>(IWampRawRpcOperationRouterCal
176175 for ( int i = 0 ; i < n ; i ++ )
177176 {
178177 caller . Result ( WampObjectFormatter . Value ,
179- new YieldOptions { Progress = true } ,
180- new object [ ] { i } ) ;
178+ new YieldOptions { Progress = true } ,
179+ new object [ ] { i } ) ;
181180 }
182181
183182 if ( EndWithError )
184183 {
185184 caller . Error ( WampObjectFormatter . Value ,
186185 new Dictionary < string , string > ( ) ,
187186 "longop.error" ,
188- new object [ ] { "Something bad happened" } ) ;
187+ new object [ ] { "Something bad happened" } ) ;
189188 }
190189 else
191190 {
@@ -210,20 +209,20 @@ public interface ILongOpService
210209 {
211210 [ WampProcedure ( MyOperation . ProcedureUri ) ]
212211 [ WampProgressiveResultProcedure ]
213- Task < int > LongOp ( int n , IProgress < int > progress ) ;
212+ Task < string > LongOp ( int n , IProgress < int > progress ) ;
214213 }
215214
216215 public class LongOpService : ILongOpService
217216 {
218- public async Task < int > LongOp ( int n , IProgress < int > progress )
217+ public async Task < string > LongOp ( int n , IProgress < int > progress )
219218 {
220219 for ( int i = 0 ; i < n ; i ++ )
221220 {
222221 progress . Report ( i ) ;
223222 await Task . Delay ( 100 ) ;
224223 }
225224
226- return n ;
225+ return n . ToString ( ) ;
227226 }
228227 }
229228
0 commit comments