Exemplo n.º 1
0
        public void SetUp()
        {
            fixture = new MPAuthTester();

            actionWhenAuthorized = new Mock<Func<string, IHttpActionResult>>(MockBehavior.Strict);
            actionWhenNotAuthorized = new Mock<Func<IHttpActionResult>>(MockBehavior.Strict);
            okResult = new OkResult(fixture);

            authType = "auth_type";
            authToken = "auth_token";
            fixture.Request = new HttpRequestMessage();
            fixture.Request.Headers.Authorization = new AuthenticationHeaderValue(authType, authToken);
            fixture.RequestContext = new HttpRequestContext();
        }
Exemplo n.º 2
0
        public void SetUp()
        {
            _userImpersonationMock = new Mock <IUserImpersonationService>();
            fixture = new MPAuthTester(_userImpersonationMock.Object);

            actionWhenAuthorized    = new Mock <Func <string, IHttpActionResult> >(MockBehavior.Strict);
            actionWhenNotAuthorized = new Mock <Func <IHttpActionResult> >(MockBehavior.Strict);
            okResult = new OkResult(fixture);

            authType        = "auth_type";
            authToken       = "auth_token";
            fixture.Request = new HttpRequestMessage();
            fixture.Request.Headers.Authorization = new AuthenticationHeaderValue(authType, authToken);
            fixture.RequestContext = new HttpRequestContext();
        }