コード例 #1
0
ファイル: GeneralTest.cs プロジェクト: DracoBlue/RestClientCs
        public void NotFoundWithInvalidJson()
        {
            HttpAgent    httpAgent    = new HttpAgent(serverUrl + "?_status=404&message=Message");
            HttpResponse httpResponse = httpAgent.get();

            Assert.IsInstanceOf <JsonHttpResponse>(httpResponse);
            Assert.AreEqual(httpResponse.isOk(), false);
        }
コード例 #2
0
ファイル: GeneralTest.cs プロジェクト: DracoBlue/RestClientCs
        public void PostAgainstAResourceWhichCannotBePosted()
        {
            HttpAgent httpAgent = new HttpAgent(serverUrl + "?_status=405&message=Method%20not%20allowed");
            Dictionary <String, String> postParameters = new Dictionary <String, String>();
            HttpResponse httpResponse = httpAgent.post(postParameters);

            Assert.IsInstanceOf <JsonHttpResponse>(httpResponse);
            Assert.AreEqual(httpResponse.isOk(), false);
        }
コード例 #3
0
ファイル: GeneralTest.cs プロジェクト: DracoBlue/RestClientCs
        public void ValidJsonGetRequest()
        {
            HttpAgent    httpAgent    = new HttpAgent(serverUrl + "?_status=200&message=Message");
            HttpResponse httpResponse = httpAgent.get();

            Assert.IsInstanceOf <JsonHttpResponse>(httpResponse);
            JsonHttpResponse jsonHttpResponse = httpResponse as JsonHttpResponse;

            Assert.AreEqual(jsonHttpResponse.getValue().Value <String>("message"), "Message");
            Assert.AreEqual(httpResponse.isOk(), true);
        }