Exemplo n.º 1
0
        public void LoadUserDelegationsTest()
        {
            string userID = UuidHelper.NewUuidString();
            WfClientDelegationCollection delegations = DelegationHelper.PrepareDelegations(userID);
            WfClientDelegationCollection sd          = WfClientProcessDescriptorServiceProxy.Instance.LoadUserDelegations(userID);

            //传递过程,客户端扩展的属性会丢失
            delegations.ForEach(action =>
            {
                action.ApplicationName = string.Empty;
                action.ProgramName     = string.Empty;
                action.TenantCode      = string.Empty;
            });

            //默认排序
            sd.Sort((m, n) => m.SourceUserName.CompareTo(n.SourceUserName));

            delegations.AreSame(sd);
        }
Exemplo n.º 2
0
        public void DeleteUserDelegationTest()
        {
            string userID = UuidHelper.NewUuidString();
            WfClientDelegationCollection delegations  = DelegationHelper.PrepareDelegations(userID);
            WfClientDelegationCollection delegations2 = DelegationHelper.PrepareDelegations(userID);

            delegations2.ForEach(action => delegations.Add(action));//同一委托人构建多条委托数据

            int count = delegations.Count;

            Assert.IsTrue(count > 2);
            WfClientDelegation delegation = delegations[0];

            WfClientProcessDescriptorServiceProxy.Instance.DeleteUserDelegation(delegation);
            int tmpCount = WfClientProcessDescriptorServiceProxy.Instance.LoadUserDelegations(userID).Count;

            Assert.AreEqual(count - 1, tmpCount);

            WfClientProcessDescriptorServiceProxy.Instance.DeleteUserDelegation(userID);
            tmpCount = WfClientProcessDescriptorServiceProxy.Instance.LoadUserDelegations(userID).Count;
            Assert.AreEqual(0, tmpCount);
        }