Example #1
0
        public void ErrPasswordMismatch()
        {
            IsReadOnlyTest = true;
            const long userId = (long)SetupUserId.Zach;

            var op = new WebUpdateUserPasswordOperation();

            TestUtil.Throws <FabPreventedFault>(() => op.Execute(OpCtx, userId, "x", "newPassword"));
        }
Example #2
0
        public void Success()
        {
            const long   userId  = (long)SetupUserId.Zach;
            const string newPass = "******";

            var           op     = new WebUpdateUserPasswordOperation();
            SuccessResult result = op.Execute(OpCtx, userId, "asdfasdf", newPass);

            Assert.NotNull(result, "Result should be filled.");
            Assert.True(result.Success, "Incorrect Success.");

            IWeaverQuery verify = Weave.Inst.Graph
                                  .V.ExactIndex <User>(x => x.VertexId, userId)
                                  .Has(x => x.Password, WeaverStepHasOp.EqualTo, DataUtil.HashPassword(newPass))
                                  .ToQuery();

            VerificationQueryFunc = () => {
                IDataResult dr = OpCtx.ExecuteForTest(verify, "UpdateUserPassword-Verify");
                Assert.AreEqual(1, dr.GetCommandResultCount(), "New element not verified.");
            };
        }
Example #3
0
 /*--------------------------------------------------------------------------------------------*/
 private void DoExecute()
 {
     vExecuteResult = vOper.Execute(vMockOpCtx.Object, vUser.VertexId, vOldPass, vNewPass);
 }