public void SendRequestTest()
        {
            var request = new WebRequestMock();
            request.Method = "POST";
            request.SetResponseData("{'status': 200, 'message': 'Successful request'}");

            var postData = new
            {
                myData = "abc123"
            };

            dynamic responseData = this.httpHelper.SendRequest(request, postData);
            Assert.IsTrue(responseData.status==200, "response status should be equal 200");
            Assert.IsTrue(((string)responseData.message).Equals("Successful request"), "response message is not correct");
        }
Beispiel #2
0
        public void SendRequestTest()
        {
            var request = new WebRequestMock();

            request.Method = "POST";
            request.SetResponseData("{'status': 200, 'message': 'Successful request'}");

            var postData = new
            {
                myData = "abc123"
            };

            dynamic responseData = this.httpHelper.SendRequest(request, postData);

            Assert.IsTrue(responseData.status == 200, "response status should be equal 200");
            Assert.IsTrue(((string)responseData.message).Equals("Successful request"), "response message is not correct");
        }