public void SuccessAdd(string pAppDomains, string pNewDomain, string pExpectDomains)
        {
            vApp.OauthDomains = pAppDomains;
            SetupUpdateQuery(pExpectDomains);

            App result = vOper.ExecuteAdd(vMockOpCtx.Object, vApp.VertexId, pNewDomain);

            Assert.AreEqual(vApp, result, "Incorrect result.");
        }
Beispiel #2
0
        public void SuccessAdd()
        {
            const long   appId      = (long)SetupAppId.KinPhoGal;
            const string addDom     = "test.com";
            const string expectDoms = SetupOauth.DomGal1 + "|" + SetupOauth.DomGal2 + "|" + addDom;

            var op     = new WebUpdateAppDomainsOperation();
            App result = op.ExecuteAdd(OpCtx, appId, addDom);

            Assert.NotNull(result, "Result should be filled.");
            Assert.AreEqual(appId, result.VertexId, "Incorrect VertexId.");
            Assert.AreEqual(expectDoms, result.OauthDomains, result.OauthDomains, addDom);

            IWeaverQuery verify = Weave.Inst.Graph
                                  .V.ExactIndex <App>(x => x.VertexId, result.VertexId)
                                  .Has(x => x.OauthDomains, WeaverStepHasOp.EqualTo, expectDoms)
                                  .ToQuery();

            VerificationQueryFunc = () => {
                IDataResult dr = OpCtx.ExecuteForTest(verify, "AddAppDomain-Verify");
                Assert.AreEqual(1, dr.GetCommandResultCount(), "New element not verified.");
            };
        }