示例#1
0
            void TestEnvironment_ConfigureUserIdLookup(MigrationTestEnvironment env, Configuration config)
            {
                var aliasMapping = new AliasMapping();

                aliasMapping.Left        = "*";
                aliasMapping.Right       = "vseqa1";
                aliasMapping.MappingRule = MappingRules.SimpleReplacement;
                var aliasMappings = new AliasMappings();

                aliasMappings.AliasMapping.Add(aliasMapping);
                aliasMappings.DirectionOfMapping = MappingDirectionEnum.LeftToRight;
                config.SessionGroup.UserIdentityMappings.AliasMappings.Add(aliasMappings);

                var domainMapping = new DomainMapping();

                domainMapping.Left        = "*";
                domainMapping.Right       = "redmond";
                domainMapping.MappingRule = MappingRules.SimpleReplacement;
                var domainMappings = new DomainMappings();

                domainMappings.DomainMapping.Add(domainMapping);
                domainMappings.DirectionOfMapping = MappingDirectionEnum.LeftToRight;
                config.SessionGroup.UserIdentityMappings.DomainMappings.Add(domainMappings);

                config.SessionGroup.UserIdentityMappings.EnableValidation = false;
                config.SessionGroup.UserIdentityMappings.UserIdentityLookupAddins.UserIdentityLookupAddin.Add(
                    "CDDE6B6B-72FC-43b6-BBD1-B8A89A788C6F"); // Tfs2010UserIdLookupAddin

                foreach (var ms in config.SessionGroup.MigrationSources.MigrationSource)
                {
                    ms.Settings.DefaultUserIdProperty.UserIdPropertyName = UserIdPropertyNameEnum.DomainAlias;
                }
            }
示例#2
0
        public void MyTestInitialize()
        {
            var mappingsCollection = new DomainMappings();

            mappingsCollection.DirectionOfMapping = MappingDirectionEnum.LeftToRight;
            foreach (var mapping in m_leftToRigthMappings)
            {
                DomainMapping mappingRule = new DomainMapping();
                mappingRule.Left        = mapping.Left;
                mappingRule.Right       = mapping.Right;
                mappingRule.MappingRule = MappingRules.SimpleReplacement;
                mappingsCollection.DomainMapping.Add(mappingRule);
            }
            m_aliasMappings.Add(mappingsCollection);

            mappingsCollection = new DomainMappings();
            mappingsCollection.DirectionOfMapping = MappingDirectionEnum.RightToLeft;
            foreach (var mapping in m_rightToLeftMappings)
            {
                DomainMapping mappingRule = new DomainMapping();
                mappingRule.Left        = mapping.Left;
                mappingRule.Right       = mapping.Right;
                mappingRule.MappingRule = MappingRules.SimpleReplacement;
                mappingsCollection.DomainMapping.Add(mappingRule);
            }
            m_aliasMappings.Add(mappingsCollection);

            mappingsCollection = new DomainMappings();
            mappingsCollection.DirectionOfMapping = MappingDirectionEnum.TwoWay;
            foreach (var mapping in m_twoWayMappings)
            {
                DomainMapping mappingRule = new DomainMapping();
                mappingRule.Left        = mapping.Left;
                mappingRule.Right       = mapping.Right;
                mappingRule.MappingRule = MappingRules.SimpleReplacement;
                mappingsCollection.DomainMapping.Add(mappingRule);
            }

            foreach (var mapping in m_ignoreMappings)
            {
                DomainMapping mappingRule = new DomainMapping();
                mappingRule.Left        = mapping.Left;
                mappingRule.Right       = mapping.Right;
                mappingRule.MappingRule = MappingRules.Ignore;
                mappingsCollection.DomainMapping.Add(mappingRule);
            }

            m_aliasMappings.Add(mappingsCollection);
        }
 /// <summary>Returns an enumerator that iterates through the resources in this response.</summary>
 public scg::IEnumerator <DomainMapping> GetEnumerator() => DomainMappings.GetEnumerator();