public void CreateRandomIdentifier_returns_alpha_characters() { var factory = new TickerFactory(); var identifier = factory.CreateRandomIdentifier(); AssertHelper.IsAscii(identifier); }
public virtual void CreateTicker_creates_ticker() { var factory = new TickerFactory(); var ticker = factory.CreateRandomTicker(); Assert.IsNotNull(ticker); }
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); }
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); }
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); }
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); }
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); }