コード例 #1
0
        public void CreateRandomIdentifier_returns_alpha_characters()
        {
            var factory    = new TickerFactory();
            var identifier = factory.CreateRandomIdentifier();

            AssertHelper.IsAscii(identifier);
        }
コード例 #2
0
        public virtual void CreateTicker_creates_ticker()
        {
            var factory = new TickerFactory();
            var ticker  = factory.CreateRandomTicker();

            Assert.IsNotNull(ticker);
        }
コード例 #3
0
        public void Signal(Node input)
        {
            // This will throw is ticket is expired, doesn't exist, etc.
            _httpService.VerifyTicket(_services, null);

            // Retrieving old ticket and using its data to create a new ticket.
            var ticket = _httpService.GetTicket(_services);

            input.Value = TickerFactory.CreateTicket(_configuration, ticket.Username, ticket.Roles);
        }
コード例 #4
0
 public IBS_G4_Drv(string Name)
 {
     this._name                   = Name != null ? Name : nameof(IBS_G4_Drv);
     this.diagnostic              = new Diagnostic(this._name);
     this.diagnostic.OnException += new ExceptionHandler(this._diagnostic_OnException);
     this._connectionDTI          = "";
     this._connectionMXI          = "";
     this.ticker                  = TickerFactory.Create(Name, this._tIntervall, this._tPriority);
     this.hdTicker                = new TickerHandler(this._ticker_OnTick);
     this.ChangeState(IBS_G4_Drv.DriverState.Idle);
 }
コード例 #5
0
        public void Initialize(string username, string server)
        {
            var concurrencyService = new ConcurrencyService();

            context = NetMQContext.Create();

            var tickerClient         = new TickerClient(context, server);
            var netMQHeartBeatClient = NetMQHeartBeatClient.CreateInstance(context, server);

            HeartBeatClient = new HeartBeatClient();

            var tickerFactory = new TickerFactory();

            TickerRepository = new TickerRepository(tickerClient, tickerFactory);
        }
コード例 #6
0
        public void Initialize(string username, string server, string authToken = null)
        {
            _connectionProvider = new ConnectionProvider(username, server);

            var tickerHubClient = new TickerHubClient(_connectionProvider);

            //if (authToken != null)
            //{
            //    var controlServiceClient = new ControlServiceClient(new AuthTokenProvider(authToken), _connectionProvider, _loggerFactory);
            //    _controlRepository = new ControlRepository(controlServiceClient);
            //}

            var concurrencyService = new ConcurrencyService();

            var tickerFactory = new TickerFactory();

            TickerRepository = new TickerRepository(tickerHubClient, tickerFactory);
        }
コード例 #7
0
        public void Signal(Node input)
        {
            if (input.Children.Any(x => x.Name != "username" && x.Name != "roles"))
            {
                throw new ApplicationException("[auth.create-ticket] can only handle [username] and [roles] children nodes");
            }

            var usernameNode = input.Children.Where(x => x.Name == "username");
            var rolesNode    = input.Children.Where(x => x.Name == "roles");

            if (usernameNode.Count() != 1 || rolesNode.Count() != 1)
            {
                throw new ApplicationException("[auth.create-ticket] must be given exactly one [username] and one [roles] children nodes");
            }

            var username = usernameNode.First().GetEx <string>(_signaler);
            var roles    = rolesNode.First().Children.Select(x => x.GetEx <string>(_signaler));

            input.Clear();
            input.Value = TickerFactory.CreateTicket(_configuration, username, roles);
        }