コード例 #1
0
        public TopologyNotification(string subscriberName, IGraphMapper mapper)
        {
            _subscriberName = subscriberName;
            _mapper         = mapper;

            _dispatcher = new GraphHubDispatcher();
        }
コード例 #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());
        }
コード例 #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);
        }
コード例 #4
0
 public PathController(ICalculationService calculationService, IGraphMapper graphMapper)
 {
     _calculationService = calculationService;
     _graphMapper        = graphMapper;
 }
コード例 #5
0
 public TopologyQueryHandler(IGraphMapper mapper, ILogger logger, IProxyFactory factory)
 {
     _mapper       = mapper;
     _logger       = logger;
     _proxyFactory = factory;
 }
コード例 #6
0
 public TopologyQueryHandler(IGraphMapper mapper)
 {
     _mapper = mapper;
 }