예제 #1
0
        public string Process(string url, string body, string response, IHttpDataCleaner secureCleaner)
        {
            var httpResult = new HttpResult
            {
                URL          = url,
                RequestBody  = body,
                ResponseBody = response
            };

            secureCleaner.CleanHttp(httpResult);

            Log(httpResult);
            return(response);
        }
예제 #2
0
        public void HttpGETCleaner_CleanHttp_HttpRESTUserAndPassInfo_HttpRESTWithoutUserAndPassInfo()
        {
            //Arrange
            var bookingcomHttpResult = new HttpResult
            {
                URL          = "http://test.com/users/max/info",
                RequestBody  = "http://test.com?user=max&pass=123456",
                ResponseBody = "http://test.com?user=max&pass=123456"
            };
            var expected = new HttpResult
            {
                URL          = "http://test.com/users/XXX/info",
                RequestBody  = "http://test.com?user=XXX&pass=XXXXXX",
                ResponseBody = "http://test.com?user=XXX&pass=XXXXXX"
            };

            //Act
            restCleaner.CleanHttp(bookingcomHttpResult);

            //Assert
            Assert.AreEqual(expected.URL, bookingcomHttpResult.URL, "URL are not equal");
            Assert.AreEqual(expected.RequestBody, bookingcomHttpResult.RequestBody, "RequestBody are not equal");
            Assert.AreEqual(expected.ResponseBody, bookingcomHttpResult.ResponseBody, "ResponseBody are not equal");
        }