public void Cant_connect() { // arrange // (will not start the server on purpose) // act + assert _socket.Invoking(s => s.Open()) .ShouldThrow <ConnectionException>() .WithMessage("Unable to connect", URI) .WithInnerException <SocketException>() .WithInnerMessage( "No connection could be made because the target machine actively refused it 127.0.0.1:8132") ; }