Exemple #1
0
        /*--------------------------------------------------------------------------------------------*/
        private static IApiResponse ExecuteAcc(IApiRequest pApiReq, string pGrantType, string pClientId,
                                               string pSecret, string pCode, string pRefresh, string pRedirUri)
        {
            Func <FabOauthAccess> getResp = (() => {
                var op = new OauthAccessOperation();
                return(op.Execute(pApiReq.OpCtx, new OauthAccessTasks(), pGrantType,
                                  pClientId, pSecret, pCode, pRefresh, pRedirUri));
            });

            var exec = new JsonExecutor <FabOauthAccess>(pApiReq, getResp);

            exec.OnException = OnAccessExecption;
            return(exec.Execute());
        }
        public void SetUp()
        {
            vMockData = new Mock <IOperationData>(MockBehavior.Strict);

            vMockOpCtx = new Mock <IOperationContext>(MockBehavior.Strict);
            vMockOpCtx.SetupGet(x => x.Data).Returns(vMockData.Object);

            vMockTasks = new Mock <IOauthAccessTasks>(MockBehavior.Strict);

            vGrantType = OauthAccessOperation.GrantTypeAc;
            vClientId  = "123";
            vSecret    = "abcdefgh12345678ABCDEFGH12345678";
            vCode      = "12345678ABCDEFGH12345678abcdefgh";
            vRefresh   = "zyxwvuts12345678ABCDEFGH12345678";
            vRedirUri  = "http://my.redirect.uri/TEST";

            vOper = new OauthAccessOperation();
        }
Exemple #3
0
        /*--------------------------------------------------------------------------------------------*/
        private FabOauthAccess ExecuteOperation()
        {
            var op = new OauthAccessOperation();

            return(op.Execute(OpCtx, vTasks, vGrantType, vClientId, vSecret, vCode, vRefresh, vRedirUri));
        }