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();
        }
Example #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();
        }
Example #3
0
		public static void WriteTokenResponse(this HttpResponseBase response, TokenResponse tokenResponse)
		{
			TokenResponseWriter writer = new TokenResponseWriter(response);

			writer.WriteResponse(tokenResponse);
		}
        public static void WriteTokenResponse(this HttpResponseBase response, TokenResponse tokenResponse)
        {
            TokenResponseWriter writer = new TokenResponseWriter(response);

            writer.WriteResponse(tokenResponse);
        }