public void FilterAndMergeNotMatchedActivityMatrixAndApprovalMatrixTest() { SOARolePropertiesQueryParam queryParam = new SOARolePropertiesQueryParam(); queryParam.QueryName = "CostCenter"; queryParam.QueryValue = "1001"; WfActivityMatrixResourceDescriptor resource = ActivityMatrixHelper.PrepareActivityMatrixResourceDescriptor(); resource.Rows.ForEach(row => row.Values.FindByColumnName(SOARolePropertyDefinition.ActivityCodeColumn).Value = "NotMatched"); SOARolePropertyRowCollection activityRows = resource.Rows.Query(queryParam); int originalActivityCount = activityRows.Count; WfApprovalMatrix approvalMatrix = ApprovalMatrixHelper.PrepareApprovalMatrix(); SOARolePropertyRowCollection approvalRows = approvalMatrix.Rows.Query(queryParam); int originalApprovalCount = approvalMatrix.PropertyDefinitions.Count - 1; activityRows.MergeApprovalMatrix(resource.PropertyDefinitions, approvalRows, approvalMatrix.PropertyDefinitions); activityRows.AssertAndOutputMatrixOperators(); Assert.AreEqual(originalActivityCount + originalApprovalCount, activityRows.Count); }
protected void MatrixTest(object sender, EventArgs e) { SOARolePropertiesQueryParam qp = new SOARolePropertiesQueryParam(); qp.QueryName = "AdminUnit"; qp.QueryValue = ""; OguDataCollection<IUser> users = GetUsersFromSOARole(new SOARolePropertiesQueryParamCollection() { qp }); users.ForEach(p => { Response.Output.WriteLine("<br/>" + p.LogOnName); }); }
public void QueryRoleSingleProperty() { SOARole role = PrepareSOARole(); SOARolePropertiesQueryParam queryParam = new SOARolePropertiesQueryParam(); queryParam.QueryName = "CostCenter"; queryParam.QueryValue = "1001"; SOARolePropertyRowCollection rows = role.Rows.Query(queryParam); Assert.AreEqual(1, rows.Count); }
protected void MatrixTest(object sender, EventArgs e) { SOARolePropertiesQueryParam qp = new SOARolePropertiesQueryParam(); qp.QueryName = "AdminUnit"; qp.QueryValue = ""; OguDataCollection <IUser> users = GetUsersFromSOARole(new SOARolePropertiesQueryParamCollection() { qp }); users.ForEach(p => { Response.Output.WriteLine("<br/>" + p.LogOnName); }); }
public void ReplaceUserInSOARoleTest() { SOARole role = PrepareSOARole(); SOARolePropertiesQueryParam queryParam = new SOARolePropertiesQueryParam(); queryParam.QueryName = "CostCenter"; queryParam.QueryValue = "1001"; SOARolePropertyRowCollection rows = role.Rows.Query(queryParam); Assert.AreEqual(1, rows.Count); foreach (var rowUsers in rows.GenerateRowsUsers()) { rowUsers.Users.ForEach(u => Console.WriteLine(u.LogOnName)); } }
public void QueryRoleSingleRemovedProperty() { SOARole role = PrepareSOARole(); role.PropertyDefinitions.Remove(spd => spd.Name == "CostCenter"); SOARolePropertyDefinitionAdapter.Instance.Update(role, role.PropertyDefinitions); SOARole roleLoaded = new SOARole(role.FullCodeName); SOARolePropertiesQueryParam queryParam = new SOARolePropertiesQueryParam(); queryParam.QueryName = "CostCenter"; queryParam.QueryValue = "1001"; SOARolePropertyRowCollection rows = roleLoaded.Rows.Query(queryParam); Assert.AreEqual(0, rows.Count); }
public void FilterAndMergeEmptyActivityMatrixAndApprovalMatrixTest() { WfActivityMatrixResourceDescriptor resource = new WfActivityMatrixResourceDescriptor(); SOARolePropertiesQueryParam queryParam = new SOARolePropertiesQueryParam(); queryParam.QueryName = "CostCenter"; queryParam.QueryValue = "1001"; WfApprovalMatrix approvalMatrix = ApprovalMatrixHelper.PrepareApprovalMatrix(); SOARolePropertyRowCollection approvalRows = approvalMatrix.Rows.Query(queryParam); resource.Rows.MergeApprovalMatrix(resource.PropertyDefinitions, approvalRows, approvalMatrix.PropertyDefinitions); //输出的只有RowNumber。因为活动矩阵没有列 resource.Rows.AssertAndOutputMatrixOperators(); Assert.AreEqual(3, resource.Rows.Count); }
public void FilterAndMergeMatchedActiveMatrixWithRoleAndApprovalMatrixTest() { SOARolePropertiesQueryParam queryParam = new SOARolePropertiesQueryParam(); queryParam.QueryName = "CostCenter"; queryParam.QueryValue = "1002"; WfActivityMatrixResourceDescriptor resource = ActivityMatrixHelper.PrepareActivityMatrixResourceDescriptor(); SOARolePropertyRowCollection activityRows = resource.Rows.Query(queryParam); int originalCount = activityRows.Count; WfApprovalMatrix approvalMatrix = ApprovalMatrixHelper.PrepareApprovalMatrix(); SOARolePropertyRowCollection approvalRows = approvalMatrix.Rows.Query(queryParam); activityRows.MergeApprovalMatrix(resource.PropertyDefinitions, approvalRows, approvalMatrix.PropertyDefinitions); activityRows.AssertAndOutputMatrixOperators(); Assert.AreEqual(3, activityRows.Count); }