public void ReturnCorrectWebPurifyCheckResponseForReplaceRequest(int count, string text)
        {
            // arrange
            var expectedResponse = new WebPurifyReplaceResponse { Count = count, Text = text };
            var xml =
                @"<?xml version=""1.0"" encoding=""utf-8"" ?>
                <rsp stat=""ok"">
                  <method>webpurify.live.replace</method>
                  <format>rest</format>
                  <found>{0}</found>
                  <text>{1}</text>
                  <api_key>api_key</api_key>
                </rsp>";
            xml = string.Format(xml, count, text);

            // act
            var resultResponse = WebPurifyCreateResponse.CreateWebPurifyReplaceResponse(XDocument.Parse(xml));

            // assert
            Assert.AreEqual(expectedResponse.Count, resultResponse.Count);
            Assert.AreEqual(expectedResponse.Text, resultResponse.Text);
        }
        public void ReturnCorrectWebPurifyCheckResponseForErrorRequest(string code, string msg)
        {
            // arrange
            var expectedResponse1 = new WebPurifyCheckResponse { ErrorCode = code, ErrorMessage = msg };
            var expectedResponse2 = new WebPurifyReplaceResponse { ErrorCode = code, ErrorMessage = msg };
            var expectedResponse3 = new WebPurifyManageListResponse { ErrorCode = code, ErrorMessage = msg };
            var expectedResponse4 = new WebPurifyGetListResponse { ErrorCode = code, ErrorMessage = msg };
            var xml =
                @"<?xml version=""1.0"" encoding=""utf-8""?>
	            <rsp stat=""fail"">
	                <err code=""{0}"" msg=""{1}"" />
                    <text>string</text>
                </rsp>";
            xml = string.Format(xml, code, msg);

            // act
            var resultResponse1 = WebPurifyCreateResponse.CreateWebPurifyCheckResponse(XDocument.Parse(xml));
            var resultResponse2 = WebPurifyCreateResponse.CreateWebPurifyReplaceResponse(XDocument.Parse(xml));
            var resultResponse3 = WebPurifyCreateResponse.CreateWebPurifyManageListResponse(XDocument.Parse(xml));
            var resultResponse4 = WebPurifyCreateResponse.CreateWebPurifyGetListResponse(XDocument.Parse(xml));

            // assert
            Assert.AreEqual(expectedResponse1.ErrorCode, resultResponse1.ErrorCode);
            Assert.AreEqual(expectedResponse2.ErrorCode, resultResponse2.ErrorCode);
            Assert.AreEqual(expectedResponse3.ErrorCode, resultResponse3.ErrorCode);
            Assert.AreEqual(expectedResponse4.ErrorCode, resultResponse4.ErrorCode);

            Assert.AreEqual(expectedResponse1.ErrorMessage, resultResponse1.ErrorMessage);
            Assert.AreEqual(expectedResponse2.ErrorMessage, resultResponse2.ErrorMessage);
            Assert.AreEqual(expectedResponse3.ErrorMessage, resultResponse3.ErrorMessage);
            Assert.AreEqual(expectedResponse4.ErrorMessage, resultResponse4.ErrorMessage);
        }