public static WfClientDelegationCollection PrepareDelegations(string userID)
        {
          
            WfClientDelegationCollection delegations = new WfClientDelegationCollection();
            WfClientDelegation delegation = PrepareDelegation();
            delegation.SourceUserID = userID;
            delegation.SourceUserName = "******" + delegation.SourceUserName;
            WfClientProcessDescriptorServiceProxy.Instance.UpdateUserDelegation(delegation);           
            delegations.Add(delegation);

            delegation = PrepareDelegation();
            delegation.SourceUserID = userID;
            delegation.SourceUserName = "******" + delegation.SourceUserName;
            WfClientProcessDescriptorServiceProxy.Instance.UpdateUserDelegation(delegation);
            delegations.Add(delegation);

            return delegations;
        }
Beispiel #2
0
        public static WfClientDelegationCollection PrepareDelegations(string userID)
        {
            WfClientDelegationCollection delegations = new WfClientDelegationCollection();
            WfClientDelegation           delegation  = PrepareDelegation();

            delegation.SourceUserID   = userID;
            delegation.SourceUserName = "******" + delegation.SourceUserName;
            WfClientProcessDescriptorServiceProxy.Instance.UpdateUserDelegation(delegation);
            delegations.Add(delegation);

            delegation = PrepareDelegation();
            delegation.SourceUserID   = userID;
            delegation.SourceUserName = "******" + delegation.SourceUserName;
            WfClientProcessDescriptorServiceProxy.Instance.UpdateUserDelegation(delegation);
            delegations.Add(delegation);

            return(delegations);
        }
Beispiel #3
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);
        }