private GroupType CreateGroupType(string name) { GroupType groupType = GroupType.NewObject(); groupType.Name = name; return(groupType); }
public void GetDisplayName() { GroupType groupType = GroupType.NewObject(); groupType.Name = "GroupTypeName"; Assert.That(groupType.DisplayName, Is.EqualTo("GroupTypeName")); }
public GroupType CreateGroupType(string name) { using (_transaction.EnterNonDiscardingScope()) { GroupType groupType = GroupType.NewObject(); groupType.Name = name; return(groupType); } }
public void ValidateSpecificGroupType_IsValid_IfBranchOfOwningGroup() { var groupType = GroupType.NewObject(); var ace = _testHelper.CreateAceWithBranchOfOwningGroup(groupType); AccessControlEntryValidationResult result = ace.Validate(); Assert.That(result.IsValid, Is.True); }
public void ValidateSpecificGroupType_IsNotValidWithNull_IfBranchOfOwningGroup() { var groupType = GroupType.NewObject(); var ace = _testHelper.CreateAceWithBranchOfOwningGroup(groupType); ace.SpecificGroupType = null; AccessControlEntryValidationResult result = ace.Validate(); Assert.That(result.GetErrors(), Is.EqualTo(new object[] { AccessControlEntryValidationError.IsSpecificGroupTypeMissing })); }
public void DoNotClearSpecificGroupType_IfBranchOfOwningGroup() { var groupType = GroupType.NewObject(); var ace = _testHelper.CreateAceWithSpecificGroupType(groupType); using (ClientTransaction.Current.CreateSubTransaction().EnterDiscardingScope()) { ace.GroupCondition = GroupCondition.BranchOfOwningGroup; ClientTransactionScope.CurrentTransaction.Commit(); Assert.That(ace.SpecificGroupType, Is.Not.Null); } }
private static GroupTypePosition CreateGroupTypePosition() { OrganizationalStructureFactory factory = new OrganizationalStructureFactory(); GroupTypePosition groupTypePosition = GroupTypePosition.NewObject(); groupTypePosition.GroupType = GroupType.NewObject(); groupTypePosition.GroupType.Name = "GroupTypeName"; groupTypePosition.Position = factory.CreatePosition(); groupTypePosition.Position.Name = "PositionName"; return(groupTypePosition); }