public void Dispose_Initialized_NotThrows() { var client = new ClientSafe("inproc://test"); client.Init(); Assert.DoesNotThrow( () => client.Dispose()); }
public void Dispose_Initialized_Twice_ThrowsFaultException() { var client = new ClientSafe("inproc://test"); client.Init(); client.Dispose(); Assert.Throws <FaultException>( () => client.Dispose(), "Cannot close an uninitialised Msg."); }
public void Template() { using (var server = new AsyncServer(new Handler())) { server.Bind("inproc://test"); var client = new ClientSafe("inproc://test"); client.Init(); client.Task.Wait(); Assert.Throws <ArgumentNullException>(() => client.Dispose()); } }
public void AwaitClientTask_MissingEndpoint_ThrowsEndpointNotFoundException() { using (var client = new ClientSafe("inproc://test")) Assert.Throws <EndpointNotFoundException>( async() => { client.Init(); await client.Task; }); }
public void AwaitClientTask_InvalidAddress_ThrowsArgumentOutOfRangeException() { using (var client = new ClientSafe("abc")) Assert.Throws <ArgumentOutOfRangeException>( async() => { client.Init(); await client.Task; }); }
public void AwaitClientTask_NullAddress_ThrowsNullReferenceException() { using (var client = new ClientSafe(null)) Assert.Throws <NullReferenceException>( async() => { client.Init(); await client.Task; }); }
public void Init_MissingEndpoint_NotFails() { using (var client = new ClientSafe("inproc://test")) Assert.DoesNotThrow(() => client.Init()); }
public void Init_InvalidAddress_NotFails() { using (var client = new ClientSafe("abc")) Assert.DoesNotThrow(() => client.Init()); }
public void Init_NullAddress_NotFails() { using (var client = new ClientSafe(null)) Assert.DoesNotThrow(() => client.Init()); }