public void ShallThrowWhenConnectingToStoppedServer(string serverAddress, string client1Address) { //Arrange var server = new EloquentServer(serverAddress); using (var client = new EloquentClient(serverAddress, client1Address)) { server.Dispose(); //Act var exception = Assert.Catch <Exception>(() => { client.Connect <IContract>("objectId"); }); //Assert if (exception is FaultException) { Assert.IsInstanceOf <IOException>(exception); } Assert.AreEqual("Connection failed. Check that server is still alive", exception.Message); } }
public void Dispose() { _eloquentServer.Dispose(); }