示例#1
0
        private GroupType CreateGroupType(string name)
        {
            GroupType groupType = GroupType.NewObject();

            groupType.Name = name;

            return(groupType);
        }
示例#2
0
        public void GetDisplayName()
        {
            GroupType groupType = GroupType.NewObject();

            groupType.Name = "GroupTypeName";

            Assert.That(groupType.DisplayName, Is.EqualTo("GroupTypeName"));
        }
示例#3
0
 public GroupType CreateGroupType(string name)
 {
     using (_transaction.EnterNonDiscardingScope())
     {
         GroupType groupType = GroupType.NewObject();
         groupType.Name = name;
         return(groupType);
     }
 }
示例#4
0
        public void ValidateSpecificGroupType_IsValid_IfBranchOfOwningGroup()
        {
            var groupType = GroupType.NewObject();
            var ace       = _testHelper.CreateAceWithBranchOfOwningGroup(groupType);

            AccessControlEntryValidationResult result = ace.Validate();

            Assert.That(result.IsValid, Is.True);
        }
示例#5
0
        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 }));
        }
示例#6
0
        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);
            }
        }
示例#7
0
        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);
        }