TwinAllOperationsInitializer(RegistryManager registryManager, ModuleClient moduleClient, ITwinTestResultHandler resultHandler, TwinEventStorage storage, TwinState twinState)
 {
     this.reportedPropertyUpdater     = new ReportedPropertyUpdater(registryManager, moduleClient, resultHandler, twinState);
     this.desiredPropertyUpdater      = new DesiredPropertyUpdater(registryManager, resultHandler, twinState);
     this.desiredPropertyReceiver     = new DesiredPropertyReceiver(registryManager, moduleClient, resultHandler);
     this.reportedPropertiesValidator = new ReportedPropertiesValidator(registryManager, moduleClient, storage, resultHandler, twinState);
     this.desiredPropertiesValidator  = new DesiredPropertiesValidator(registryManager, moduleClient, storage, resultHandler, twinState);
 }
Esempio n. 2
0
        TwinAllOperationsInitializer(RegistryManager registryManager, ModuleClient moduleClient, ITwinTestResultHandler resultHandler, TwinEventStorage storage, TwinTestState twinTestState)
        {
            this.registryManager             = registryManager;
            this.twinTestState               = twinTestState;
            this.reportedPropertyUpdater     = new ReportedPropertyUpdater(moduleClient, resultHandler, twinTestState.ReportedPropertyUpdateCounter);
            this.desiredPropertyUpdater      = new DesiredPropertyUpdater(registryManager, resultHandler, twinTestState);
            this.desiredPropertyReceiver     = new DesiredPropertyReceiver(moduleClient, resultHandler);
            this.reportedPropertiesValidator = new ReportedPropertiesValidator(registryManager, moduleClient, storage, resultHandler, twinTestState);
            this.desiredPropertiesValidator  = new DesiredPropertiesValidator(registryManager, moduleClient, storage, resultHandler, twinTestState);

            moduleClient.SetConnectionStatusChangesHandler((status, reason) =>
            {
                Logger.LogInformation($"Detected change in connection status:{Environment.NewLine}Changed Status: {status} Reason: {reason}");
                if (status == ConnectionStatus.Disconnected_Retrying)
                {
                    this.twinTestState.EdgeHubLastStopped = DateTime.UtcNow;
                }
                else if (status == ConnectionStatus.Connected)
                {
                    this.twinTestState.EdgeHubLastStarted = DateTime.UtcNow;
                }
            });
        }