Ejemplo n.º 1
0
        /*--------------------------------------------------------------------------------------------*/
        private OauthMember GetOauthMember(IOperationData pData, Member pMemPath, string pName)
        {
            IWeaverVarAlias <Member> memAlias;
            IWeaverQuery             memQ = pMemPath.ToQueryAsVar("m", out memAlias);

            IWeaverQuery appQ = Weave.Inst.FromVar(memAlias)
                                .DefinedByApp.ToApp
                                .Property(x => x.VertexId)
                                .ToQuery();

            IDataAccess acc = pData.Build(null, true);

            acc.AddSessionStart();
            acc.AddQuery(memQ, true);
            acc.AppendScriptToLatestCommand("(m?m=m.next():null);");
            string memCmdId = acc.GetLatestCommandId();

            acc.AddQuery(appQ, true);
            acc.AddConditionsToLatestCommand(memCmdId);
            acc.AddSessionClose();

            IDataResult res = acc.Execute("OauthAccess-" + pName);

            if (res.GetCommandResultCount(1) == 0)
            {
                return(null);
            }

            var om = new OauthMember();

            om.Member = res.ToElementAt <Member>(1, 0);
            om.AppId  = res.ToLongAt(2, 0);
            return(om);
        }
Ejemplo n.º 2
0
        public void NewData(string pSessId, bool pCmdId, bool pCmdTimers)
        {
            vMockFact.Setup(x => x.Create(pSessId, pCmdId, pCmdTimers)).Returns(vMockAcc.Object);

            IDataAccess result = vData.Build(pSessId, pCmdId, pCmdTimers);

            Assert.AreEqual(vMockAcc.Object, result, "Incorrect result.");
        }