public void remote_manager_should_throw_exception_for_call_TryUpServer_with_allready_busy_port()
        {
            SoapServerManagerWebRef.ServerManager client = new SoapServerManagerWebRef.ServerManager()
            {
                Url = TestContext.Properties["AspNetDevelopmentServer.FakeServerManager"].ToString() + "ServerManager.asmx"
            };

            long servId = client.TryUpServer(LISTNED_HOST_FAKE_SERVER);

            try
            {
                client.TryUpServer(LISTNED_HOST_FAKE_SERVER);
            }
            finally
            {
                client.ShutDownServer(servId);
            }
        }
        public void remote_manager_should_able_to_TryUpServer_on_localhost()
        {
            SoapServerManagerWebRef.ServerManager client = new SoapServerManagerWebRef.ServerManager()
            {
                Url = TestContext.Properties["AspNetDevelopmentServer.FakeServerManager"].ToString() + "ServerManager.asmx"
            };

            long idServer = client.TryUpServer(LISTNED_HOST_FAKE_SERVER);

            try
            {
                should_listining_the_host(LISTNED_HOST_FAKE_SERVER);
            }
            finally
            {
                client.ShutDownServer(idServer);
            }
        }
        public void remote_manager_should_throw_soapException_during_call_ShutDownServer_if_some_receiver_conditional_message_is_not_met()
        {
            SoapServerManagerWebRef.ServerManager client = new SoapServerManagerWebRef.ServerManager()
            {
                Url = TestContext.Properties["AspNetDevelopmentServer.FakeServerManager"].ToString() + "ServerManager.asmx"
            };

            long serverId = client.TryUpServer(LISTNED_HOST_FAKE_SERVER);

            try
            {
                long conditionalId = client.CreateReceivedConditional(serverId, 0);
                client.TheConditionalShouldBeExpectPostWithRquestBody(serverId, conditionalId, "example");
            }
            finally
            {
                client.ShutDownServer(serverId);
            }
        }
        public void remote_manager_should_able_to_set_return_history_of_all_requests()
        {
            SoapServerManagerWebRef.ServerManager client = new SoapServerManagerWebRef.ServerManager()
            {
                Url = TestContext.Properties["AspNetDevelopmentServer.FakeServerManager"].ToString() + "ServerManager.asmx"
            };

            long serverId = client.TryUpServer(LISTNED_HOST_FAKE_SERVER);

            try
            {
                HttpSender.SendPost(LISTNED_HOST_FAKE_SERVER, REQUST_BODY);
                string[] actualHistoryRequests = client.GetReceiveHistoryForFakeServer(serverId);
                Assert.AreEqual(1, actualHistoryRequests.Length, "Wrong count of element for array was returned by method GetReciveHistoryForFakeServer");
                Assert.AreEqual(REQUST_BODY, actualHistoryRequests[0], "Wrong content of element for array was returned by method GetReciveHistoryForFakeServer");
            }
            finally
            {
                client.ShutDownServer(serverId);
            }
        }
        public void remote_manager_should_able_to_set_rquest_and_response_for_concret_request()
        {
            SoapServerManagerWebRef.ServerManager client = new SoapServerManagerWebRef.ServerManager()
            {
                Url = TestContext.Properties["AspNetDevelopmentServer.FakeServerManager"].ToString() + "ServerManager.asmx"
            };
            long serverId = client.TryUpServer(LISTNED_HOST_FAKE_SERVER);

            try
            {
                long conditionalId = client.CreateReceivedConditional(serverId, 0);
                client.TheConditionalShouldBeExpectPostWithRquestBody(serverId, conditionalId, REQUST_BODY);
                client.ForTheConditionalResponseBodyShouldBe(serverId, conditionalId, RESPONSE_BODY, null);

                string actualAnswer = HttpSender.SendPost(LISTNED_HOST_FAKE_SERVER, REQUST_BODY);
                Assert.AreEqual(RESPONSE_BODY, actualAnswer, "Remote fake server shoul answer response like was set by method ForTheConditionalResponseBodyShouldBe");
            }
            finally
            {
                client.ShutDownServer(serverId);
            }
        }