コード例 #1
0
 public FileUploadE2ETests()
 {
     _listener = new ConsoleEventListener("Microsoft-Azure-");
 }
コード例 #2
0
 public TwinE2ETests()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #3
0
 public MethodFaultInjectionTests()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #4
0
 public MethodE2ETests()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #5
0
 public ReprovisioningE2ETests()
 {
     _listener = TestConfig.StartEventListener();
 }
 public AzureSecurityCenterForIoTSecurityMessageE2ETests()
 {
     _listener = TestConfig.StartEventListener();
     _logAnalyticsClient = AzureSecurityCenterForIoTLogAnalyticsClient.CreateClient();
 }
 public MessageSendE2EMultiplexingTests()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #8
0
 public FaultInjectionPoolAmqpTests()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #9
0
#pragma warning restore CA1823

        public MessageReceiveFaultInjectionTests()
        {
            _listener = TestConfig.StartEventListener();
        }
コード例 #10
0
 public DeviceTokenRefreshE2ETests()
 {
     _listener = new ConsoleEventListener("Microsoft-Azure-");
     _log      = TestLogging.GetInstance();
 }
コード例 #11
0
 public TwinE2EMultiplexingTests()
 {
     _listener = TestConfig.StartEventListener();
 }
 public FileUploadFaultInjectionTests()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #13
0
 public IoTHubServiceProxyE2ETests()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #14
0
 public MessageSendE2ETests()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #15
0
 public RegistryManagerE2ETests()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #16
0
#pragma warning restore CA1823

        public FileUploadE2ETests()
        {
            _listener = TestConfig.StartEventListener();
        }
コード例 #17
0
 public MessageFeedbackE2ETests()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #18
0
 public ConnectionStatusChangeHandlerTests()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #19
0
 public ProvisioningServiceClientE2ETests()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #20
0
 public ProvisioningCertificateValidationTest()
 {
     _listener = new ConsoleEventListener("Microsoft-Azure-");
 }
コード例 #21
0
 public MethodE2ETests()
 {
     _listener = new ConsoleEventListener("Microsoft-Azure-");
 }
コード例 #22
0
 public CombinedClientOperationsMultiplexingTests()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #23
0
 public MessageReceiveE2EPoolAmqpTests()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #24
0
 public DeviceTokenRefreshE2ETests()
 {
     _listener = TestConfig.StartEventListener();
     _log      = TestLogging.GetInstance();
 }
コード例 #25
0
 public ProvisioningCertificateValidationE2ETest()
 {
     _listener = TestConfig.StartEventListener();
 }
コード例 #26
0
 public ProvisioningTests()
 {
     _listener = new ConsoleEventListener("Microsoft-Azure-");
 }
コード例 #27
0
 public IoTHubCertificateValidationTest()
 {
     _listener = new ConsoleEventListener("Microsoft-Azure-");
 }
コード例 #28
0
 public DeviceClientX509AuthenticationE2ETests()
 {
     _listener = TestConfig.StartEventListener();
     _hostName = GetHostName(Configuration.IoTHub.ConnectionString);
 }
コード例 #29
0
 public MessageSendTests()
 {
     _listener = new ConsoleEventListener("Microsoft-Azure-");
 }
コード例 #30
0
        private void InitializeBot()
        {
            var strCulture = Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;

            var culture = CultureInfo.CreateSpecificCulture("en");

            CultureInfo.DefaultThreadCurrentCulture = culture;
            Thread.CurrentThread.CurrentCulture     = culture;

            AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionEventHandler;

            _logger = new ConsoleLogger(LogLevel.LevelUp);
            Logger.SetLogger(_logger, subPath);

            var profilePath       = Path.Combine(Directory.GetCurrentDirectory(), subPath);
            var profileConfigPath = Path.Combine(profilePath, "config");
            var authFile          = Path.Combine(profileConfigPath, "auth.json");
            var configFile        = Path.Combine(profileConfigPath, "config.json");

            BoolNeedsSetup = false;

            if (File.Exists(configFile))
            {
                /** if (!VersionCheckState.IsLatest())
                 *  settings = GlobalSettings.Load(subPath, true);
                 * else **/
                _settings = GlobalSettings.Load(subPath, true);
                _settings.Auth.Load(authFile);
            }
            else
            {
                _settings = new GlobalSettings
                {
                    ProfilePath             = profilePath,
                    ProfileConfigPath       = profileConfigPath,
                    GeneralConfigPath       = Path.Combine(Directory.GetCurrentDirectory(), "config"),
                    TranslationLanguageCode = strCulture
                };
                BoolNeedsSetup = true;
            }

            _session = new Session(new ClientSettings(_settings), new LogicSettings(_settings));

            _session.Client.ApiFailure = new ApiFailureStrategy(_session);

            _machine = new StateMachine();
            var stats = new Statistics();

            // var strVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(3); NOT USED ATM

            //Status bar
            stats.DirtyEvent +=
                () =>
                SetStatusText(stats.GetTemplatedStats(
                                  _session.Translation.GetTranslation(TranslationString.StatsTemplateString),
                                  _session.Translation.GetTranslation(TranslationString.StatsXpTemplateString)));

            var aggregator = new StatisticsAggregator(stats);
            var listener   = new ConsoleEventListener();

            _session.EventDispatcher.EventReceived += evt => listener.Listen(evt, _session);
            _session.EventDispatcher.EventReceived += evt => aggregator.Listen(evt, _session);

            if (_settings.UseWebsocket)
            {
                var websocket = new WebSocketInterface(_settings.WebSocketPort, _session);
                _session.EventDispatcher.EventReceived += evt => websocket.Listen(evt, _session);
            }

            var plugins = new PluginManager(new PluginInitializerInfo
            {
                Logger     = _logger,
                Session    = _session,
                Settings   = _settings,
                Statistics = stats
            });

            plugins.InitPlugins();
            _machine.SetFailureState(new LoginState());
            Logger.SetLoggerContext(_session);

            _session.Navigation.UpdatePositionEvent +=
                (lat, lng) => _session.EventDispatcher.Send(new UpdatePositionEvent {
                Latitude = lat, Longitude = lng
            });
            _session.Navigation.UpdatePositionEvent += Navigation_UpdatePositionEvent;

            RouteOptimizeUtil.RouteOptimizeEvent +=
                optimizedroute =>
                _session.EventDispatcher.Send(new OptimizeRouteEvent {
                OptimizedRoute = optimizedroute
            });
            RouteOptimizeUtil.RouteOptimizeEvent += InitializePokestopsAndRoute;

            Navigation.GetHumanizeRouteEvent +=
                (route, destination) =>
                _session.EventDispatcher.Send(new GetHumanizeRouteEvent {
                Route = route, Destination = destination
            });
            Navigation.GetHumanizeRouteEvent += UpdateMap;

            FarmPokestopsTask.LootPokestopEvent +=
                pokestop => _session.EventDispatcher.Send(new LootPokestopEvent {
                Pokestop = pokestop
            });
            FarmPokestopsTask.LootPokestopEvent += UpdateMap;

            CatchNearbyPokemonsTask.PokemonEncounterEvent +=
                mappokemons =>
                _session.EventDispatcher.Send(new PokemonsEncounterEvent {
                EncounterPokemons = mappokemons
            });
            CatchNearbyPokemonsTask.PokemonEncounterEvent += UpdateMap;

            CatchIncensePokemonsTask.PokemonEncounterEvent +=
                mappokemons =>
                _session.EventDispatcher.Send(new PokemonsEncounterEvent {
                EncounterPokemons = mappokemons
            });
            CatchIncensePokemonsTask.PokemonEncounterEvent += UpdateMap;
        }