public OnCompleted ( MsgPack.Rpc.Client.Protocols.ClientResponseContext context, |
||
context | MsgPack.Rpc.Client.Protocols.ClientResponseContext | The response context which holds response data. |
exception | The exception occured. | |
completedSynchronously | bool | When operation is completed same thread as initiater then |
리턴 | void |
public void TestOnCompleted_CompletedSynchronouly_True_SetTrue() { object owner = new object(); var target = new RequestMessageAsyncResult( owner, 1, null, null ); target.OnCompleted( CreateContext(), null, true ); Assert.That( ( target as IAsyncResult ).CompletedSynchronously, Is.True ); }
public void TestOnCompleted_ContextIsSet() { object owner = new object(); var target = new RequestMessageAsyncResult( owner, 1, null, null ); var context = CreateContext(); target.OnCompleted( context, null, false ); Assert.That( target.Result, Is.Not.Null ); }
public void TestOnCompleted_ErrorIsSet() { object owner = new object(); var target = new RequestMessageAsyncResult( owner, 1, null, null ); var error = new Exception(); target.OnCompleted( CreateContext(), error, false ); Assert.That( target.Error, Is.SameAs( error ) ); }
public void TestOnCompleted_CallbackCalled() { bool isCallbacked = false; object owner = new object(); var target = new RequestMessageAsyncResult( owner, 1, _ => isCallbacked = true, null ); target.OnCompleted( CreateContext(), null, false ); Assert.That( isCallbacked, Is.True ); }
public void TestOnCompleted_CompletedSynchronouly_True_SetTrue() { object owner = new object(); var target = new RequestMessageAsyncResult(owner, 1, null, null); target.OnCompleted(CreateContext(), null, true); Assert.That((target as IAsyncResult).CompletedSynchronously, Is.True); }
public void TestOnCompleted_ErrorIsSet() { object owner = new object(); var target = new RequestMessageAsyncResult(owner, 1, null, null); var error = new Exception(); target.OnCompleted(CreateContext(), error, false); Assert.That(target.Error, Is.SameAs(error)); }
public void TestOnCompleted_ContextIsSet() { object owner = new object(); var target = new RequestMessageAsyncResult(owner, 1, null, null); var context = CreateContext(); target.OnCompleted(context, null, false); Assert.That(target.Result, Is.Not.Null); }
public void TestOnCompleted_CallbackCalled() { bool isCallbacked = false; object owner = new object(); var target = new RequestMessageAsyncResult(owner, 1, _ => isCallbacked = true, null); target.OnCompleted(CreateContext(), null, false); Assert.That(isCallbacked, Is.True); }