コード例 #1
0
        public void TestWritingResponse()
        {
            TokenResponse response = new TokenResponse
            {
                Body = "body",
                HttpStatusCode = 200
            };

            Mock<HttpResponseBase> mckResponse = new Mock<HttpResponseBase>();
            mckResponse.SetupSet(x => x.ContentType = "application/json");
            mckResponse.SetupSet(x => x.StatusCode = 200);
            mckResponse.Setup(x => x.Write("body"));
            TokenResponseWriter writer = new TokenResponseWriter(mckResponse.Object);
            writer.WriteResponse(response);
            mckResponse.VerifyAll();
        }
コード例 #2
0
        public void TestWritingResponse()
        {
            TokenResponse response = new TokenResponse
            {
                Body           = "body",
                HttpStatusCode = 200
            };

            Mock <HttpResponseBase> mckResponse = new Mock <HttpResponseBase>();

            mckResponse.SetupSet(x => x.ContentType = "application/json");
            mckResponse.SetupSet(x => x.StatusCode  = 200);
            mckResponse.Setup(x => x.Write("body"));
            TokenResponseWriter writer = new TokenResponseWriter(mckResponse.Object);

            writer.WriteResponse(response);
            mckResponse.VerifyAll();
        }
コード例 #3
0
		public static void WriteTokenResponse(this HttpResponseBase response, TokenResponse tokenResponse)
		{
			TokenResponseWriter writer = new TokenResponseWriter(response);

			writer.WriteResponse(tokenResponse);
		}
コード例 #4
0
        public static void WriteTokenResponse(this HttpResponseBase response, TokenResponse tokenResponse)
        {
            TokenResponseWriter writer = new TokenResponseWriter(response);

            writer.WriteResponse(tokenResponse);
        }