Beispiel #1
0
        public void TestRequestCreatesNewRequestwithInputtedUri()
        {
            RequestWrapper r = new RequestWrapper();

            r.MakeRequest(HttpVerb.Get, "http://test.com", null, null, null);
            Assert.AreEqual(new Uri("http://test.com").AbsoluteUri, r.WebRequest.RequestUri.AbsoluteUri);
        }
Beispiel #2
0
        public void TestMethodIsPassedToHttpRequest()
        {
            webRequestMock.SetupSet(req => req.Method = It.IsAny <String>()).Verifiable();
            RequestWrapper r = new RequestWrapper(webRequestMock.Object);

            r.MakeRequest(HttpVerb.Head, "http://test.com", null, null, null);
            webRequestMock.VerifySet(req => req.Method = It.Is <String>(s => s.Equals("HEAD")));
        }
Beispiel #3
0
        public void TestMakeRequestThrowsExceptionWithBodyWhenUrlNull()
        {
            RequestWrapper req = new RequestWrapper();

            req.MakeRequest(HttpVerb.Post, null, null, null, null);
        }
Beispiel #4
0
        public void TestMethodIsPassedToHttpRequest()
        {
            webRequestMock.SetupSet(req => req.Method=It.IsAny<String>()).Verifiable();
            RequestWrapper r = new RequestWrapper(webRequestMock.Object);
            r.MakeRequest(HttpVerb.Head, "http://test.com", null, null, null);
            webRequestMock.VerifySet(req => req.Method = It.Is<String>(s => s.Equals("HEAD")));

        }
Beispiel #5
0
 public void TestRequestCreatesNewRequestwithInputtedUri()
 {
     RequestWrapper r = new RequestWrapper();
     r.MakeRequest(HttpVerb.Get, "http://test.com", null, null, null);
     Assert.AreEqual(new Uri("http://test.com").AbsoluteUri, r.WebRequest.RequestUri.AbsoluteUri);
 }
Beispiel #6
0
        public void TestMakeRequestThrowsExceptionWithBodyWhenUrlNull()
        {
            RequestWrapper req = new RequestWrapper();
            req.MakeRequest(HttpVerb.Post, null, null, null, null);

        }