Inheritance: IVersionOneProcessor
示例#1
0
 public V1Component(VersionOneSettings settings)
 {
     Settings = settings;
     var nativeSettings = ConvertSettings(settings);
     processor = new VersionOneProcessor(nativeSettings, new BlackholeLogger());
     AddProperties();
 }
        public static VersionOneProcessor build(ILogger logger)
        {
            XmlElement config = Enviornment.instance.GetVersionOneConfiguration();

            VersionOneProcessor v1processor = new VersionOneProcessor(config, logger);
            InitializaProcessorWithDefaultProperites(v1processor);
            ExtraInitialization(v1processor);

            return v1processor;
        }
 public void SetUp()
 {
     v1processor = V1ProcessorFactory.build(new LoggerImpl());
     v1processor.ValidateConnection();
 }
        public void TestFixtureSetUp()
        {
            IAPIConnector metaConnector = new V1APIConnector(V1Url + MetaUrl, Username, Password);
            IAPIConnector serviceConnector = new V1APIConnector(V1Url + DataUrl, Username, Password);
            MetaModel = new MetaModel(metaConnector);
            Services = new Services(MetaModel, serviceConnector);

            var doc = new XmlDocument();
            doc.LoadXml(string.Format(@"<Settings>
                            <APIVersion>7.2.0.0</APIVersion>
                            <ApplicationUrl>{0}</ApplicationUrl>
                            <Username>{1}</Username>
                            <Password>{2}</Password>
                            <IntegratedAuth>false</IntegratedAuth>
                            <ProxySettings disabled='1'>
                                 <Uri>http://proxyhost:3128</Uri>
                                    <UserName>username</UserName>
                                    <Password>password</Password>
                                    <Domain>domain</Domain>
                                </ProxySettings>
                            </Settings>", V1Url, Username, Password));

            var loggerMock = MockRepository.Stub<ILogger>();
            V1Processor = new VersionOneProcessor(doc["Settings"], loggerMock);
            V1Processor.AddProperty(Workitem.NumberProperty, VersionOneProcessor.PrimaryWorkitemType, false);
            V1Processor.AddProperty(Entity.NameProperty, VersionOneProcessor.PrimaryWorkitemType, false);
            V1Processor.AddProperty(Workitem.DescriptionProperty, VersionOneProcessor.PrimaryWorkitemType, false);
            V1Processor.AddProperty(Workitem.PriorityProperty, VersionOneProcessor.PrimaryWorkitemType, true);
            V1Processor.AddProperty(Entity.StatusProperty, VersionOneProcessor.PrimaryWorkitemType, false);
            V1Processor.AddProperty(Workitem.EstimateProperty, VersionOneProcessor.PrimaryWorkitemType, false);
            V1Processor.AddProperty(Workitem.AssetTypeProperty, VersionOneProcessor.PrimaryWorkitemType, false);
            V1Processor.AddProperty(Workitem.ParentNameProperty, VersionOneProcessor.PrimaryWorkitemType, false);
            V1Processor.AddProperty(Workitem.TeamNameProperty, VersionOneProcessor.PrimaryWorkitemType, false);
            V1Processor.AddProperty(Workitem.SprintNameProperty, VersionOneProcessor.PrimaryWorkitemType, false);
            V1Processor.AddProperty(Workitem.OrderProperty, VersionOneProcessor.PrimaryWorkitemType, false);
            V1Processor.AddProperty(Workitem.ReferenceProperty, VersionOneProcessor.PrimaryWorkitemType, false);
            V1Processor.AddProperty(Entity.NameProperty, VersionOneProcessor.StoryType, false);

            V1Processor.AddProperty(CustomFieldName, VersionOneProcessor.FeatureGroupType, false);
            V1Processor.AddProperty(CustomTypeName, string.Empty, true);
            V1Processor.AddProperty(Entity.NameProperty, VersionOneProcessor.FeatureGroupType, false);
            V1Processor.AddProperty(Workitem.ReferenceProperty, VersionOneProcessor.FeatureGroupType, false);
            V1Processor.AddProperty(VersionOneProcessor.OwnersAttribute, VersionOneProcessor.FeatureGroupType, false);

            V1Processor.AddProperty(FieldInfo.NameProperty, VersionOneProcessor.AttributeDefinitionType, false);
            V1Processor.AddProperty(FieldInfo.AssetTypeProperty, VersionOneProcessor.AttributeDefinitionType, false);
            V1Processor.AddProperty(FieldInfo.AttributeTypeProperty, VersionOneProcessor.AttributeDefinitionType, false);
            V1Processor.AddProperty(FieldInfo.IsReadOnlyProperty, VersionOneProcessor.AttributeDefinitionType, false);
            V1Processor.AddProperty(FieldInfo.IsRequiredProperty, VersionOneProcessor.AttributeDefinitionType, false);

            V1Processor.AddListProperty(CustomFieldName, VersionOneProcessor.FeatureGroupType);

            V1Processor.AddProperty(Entity.NameProperty, VersionOneProcessor.LinkType, false);
            V1Processor.AddProperty(Link.UrlProperty, VersionOneProcessor.LinkType, false);
            V1Processor.AddProperty(Link.OnMenuProperty, VersionOneProcessor.LinkType, false);

            V1Processor.AddProperty(Entity.NameProperty, VersionOneProcessor.MemberType, false);
            V1Processor.AddProperty(Member.EmailProperty, VersionOneProcessor.MemberType, false);
            //V1Processor.AddProperty(Member.DefaultRoleNameProperty, VersionOneProcessor.MemberType, false);

            Assert.IsTrue(V1Processor.ValidateConnection(), "Connection is not valid");
        }