public TopologyNotification(string subscriberName, IGraphMapper mapper)
        {
            _subscriberName = subscriberName;
            _mapper         = mapper;

            _dispatcher = new GraphHubDispatcher();
        }
Esempio n. 2
0
        public NotifySubscriberProvider(string subscriberName)
        {
            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            _subscriberName = subscriberName;
            _graphMapper    = new GraphMapper();
            _outageMapper   = new OutageMapper(new ConsumerMapper(), new EquipmentMapper());
        }
Esempio n. 3
0
        public void SetUp()
        {
            //Mock creation
            _mockInputSource  = Mock.Of <IInputSource>();
            _mockMapperConfig = Mock.Of <IMapperConfig>();
            IStatementsConfig   statementsConfig = Mock.Of <IStatementsConfig>();
            IStatementAssembler assemblerMock    = Mock.Of <IStatementAssembler>();

            //Mock setups
            Mock.Get(_mockMapperConfig)
            .Setup(f => f.ListNamespaces())
            .Returns(new Dictionary <string, string>()
            {
                { "prefix1", "ns1" },
                { "prefix2", "ns2" }
            });

            Mock.Get(_mockMapperConfig)
            .Setup(f => f.ListStatementsConfigs())
            .Returns(new List <IStatementsConfig>()
            {
                statementsConfig
            });

            //Instance creation
            BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Instance;

            _graphMapper = (T)Activator.CreateInstance(typeof(T), flags, null, new object[] { assemblerMock }, null);

            //Fake setup
            IGenericGraph fakeGraph = (IGenericGraph)Activator.CreateInstance(_graphMapper.GetGraphType());

            //Mock setup
            Mock.Get(assemblerMock)
            .Setup(f => f.AssembleEntityStatements(
                       It.IsAny <IInputSource>(),
                       It.IsAny <IStatementsConfig>(),
                       It.IsAny <IDictionary <string, string> >()))
            .Returns(fakeGraph);
        }
Esempio n. 4
0
 public PathController(ICalculationService calculationService, IGraphMapper graphMapper)
 {
     _calculationService = calculationService;
     _graphMapper        = graphMapper;
 }
 public TopologyQueryHandler(IGraphMapper mapper, ILogger logger, IProxyFactory factory)
 {
     _mapper       = mapper;
     _logger       = logger;
     _proxyFactory = factory;
 }
Esempio n. 6
0
 public TopologyQueryHandler(IGraphMapper mapper)
 {
     _mapper = mapper;
 }