Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LoggerManagementSetup"/> class.
        /// </summary>
        public LoggerManagementSetup()
        {
            _logger.EnteringMethodPart();
            // get external parts to compose
            IServiceLocator _serviceLocator = ServiceLocator.Current;
            string          _ConsumerConfigurationFileName = _serviceLocator.GetInstance <string>(ConsumerCompositionSettings.ConfigurationFileNameContract);

            _ViewModel = _serviceLocator.GetInstance <ConsumerViewModel>(ConsumerCompositionSettings.ViewModelContract);
            _logger.Composed(nameof(_ViewModel), _ViewModel.GetType().FullName);
            EncodingFactory = _serviceLocator.GetInstance <IEncodingFactory>();
            _logger.Composed(nameof(EncodingFactory), EncodingFactory.GetType().FullName);
            MessageHandlerFactory = _serviceLocator.GetInstance <IMessageHandlerFactory>();
            _logger.Composed(nameof(MessageHandlerFactory), MessageHandlerFactory.GetType().FullName);
            // setup local functionality
            ConfigurationFactory = new ConsumerConfigurationFactory(_ConsumerConfigurationFileName);
            _logger.Composed(nameof(ConfigurationFactory), ConfigurationFactory.GetType().FullName);
            BindingFactory = new PartIBindingFactory(_ViewModel);
            _logger.Composed(nameof(BindingFactory), BindingFactory.GetType().FullName);
        }
Example #2
0
        public void ConstructorTestMethod()
        {
            IConfigurationFactory _configuration = null;

            Assert.ThrowsException <ArgumentException>(() => _configuration = new ConsumerConfigurationFactory("Configuration file name"));
        }