Пример #1
0
        public void Initialize(XmlElement config, IEventManager eventManager, IProfile profile)
        {
            var bugzillaConfig = new BugzillaServiceConfiguration();

            ConfigurationReader.ReadConfigurationValues(bugzillaConfig, config);

            ConfigurationReader.ProcessMappingSettings(bugzillaConfig.ProjectMappings, config[ProjectMappingsNode], BugzillaProjectNode, VersionOneProjectNode);
            ConfigurationReader.ProcessMappingSettings(bugzillaConfig.PriorityMappings, config[PriorityMappingsNode], BugzillaPriorityNode, VersionOnePriorityNode);

            sourceFieldValue = config["SourceFieldValue"].InnerText;

            this.eventManager = eventManager;
            logger            = new Logger(eventManager);
            var bugzillaClientConfiguration = new BugzillaClientConfiguration {
                UserName = bugzillaConfig.UserName, Password = bugzillaConfig.Password, Url = bugzillaConfig.Url, IgnoreSSLCert = bugzillaConfig.IgnoreCert
            };

            bugzillaClientFactory = new BugzillaClientFactory(bugzillaClientConfiguration, logger);

            var readerUpdater = new BugzillaReaderUpdater(bugzillaConfig, bugzillaClientFactory, logger);

            bugzillaReader  = readerUpdater;
            bugzillaUpdater = readerUpdater;

            this.eventManager.Subscribe(typeof(IntervalSync), OnInterval);
            this.eventManager.Subscribe(typeof(WorkitemCreationResult), OnDefectCreated);
            this.eventManager.Subscribe(typeof(WorkitemStateChangeCollection), OnDefectStateChanged);
        }
 public BugzillaMocks()
 {
     repository = new MockRepository();
     client = repository.StrictMock<IBugzillaClient>();
     serviceFactory = repository.DynamicMock<IBugzillaClientFactory>();
     logger = repository.Stub<ILogger>();
 }
 public BugzillaReaderUpdater(BugzillaServiceConfiguration configuration, IBugzillaClientFactory bugzillaClientFactory, ILogger logger)
 {
     this.configuration         = configuration;
     this.bugzillaClientFactory = bugzillaClientFactory;
     this.logger = logger;
 }
		public BugzillaReaderUpdater(BugzillaServiceConfiguration configuration, IBugzillaClientFactory bugzillaClientFactory, ILogger logger) 
        {
			this.configuration = configuration;
            this.bugzillaClientFactory = bugzillaClientFactory;
            this.logger = logger;
		}