Exemplo n.º 1
0
        Settings(
            string deviceId,
            string moduleId,
            DeploymentTesterMode testMode,
            Option <string> iotHubConnectionString,
            Uri testResultCoordinatorUrl,
            TimeSpan testStartDelay,
            TimeSpan testDuration,
            string trackingId,
            Option <string> targetModuleId,
            TimeSpan deploymentUpdatePeriod)
        {
            this.DeviceId = Preconditions.CheckNonWhiteSpace(deviceId, nameof(deviceId));
            this.ModuleId = Preconditions.CheckNonWhiteSpace(moduleId, nameof(moduleId));
            this.TestResultCoordinatorUrl = Preconditions.CheckNotNull(testResultCoordinatorUrl, nameof(testResultCoordinatorUrl));
            this.TrackingId = Preconditions.CheckNonWhiteSpace(trackingId, nameof(trackingId));

            if (testMode == DeploymentTesterMode.Sender)
            {
                Preconditions.CheckArgument(iotHubConnectionString.HasValue, nameof(iotHubConnectionString));
                this.IoTHubConnectionString = iotHubConnectionString;

                Preconditions.CheckArgument(targetModuleId.HasValue, nameof(targetModuleId));
                this.TargetModuleId = targetModuleId;
            }

            this.TestMode               = testMode;
            this.TestStartDelay         = testStartDelay;
            this.TestDuration           = testDuration;
            this.DeploymentUpdatePeriod = deploymentUpdatePeriod;
        }
Exemplo n.º 2
0
        Settings(
            string deviceId,
            string moduleId,
            DeploymentTesterMode testMode,
            string iotHubConnectionString,
            Uri testResultCoordinatorUrl,
            TimeSpan testStartDelay,
            TimeSpan testDuration,
            string trackingId,
            string targetModuleId,
            TimeSpan deploymentUpdatePeriod)
        {
            this.DeviceId = Preconditions.CheckNonWhiteSpace(deviceId, nameof(deviceId));
            this.ModuleId = Preconditions.CheckNonWhiteSpace(moduleId, nameof(moduleId));
            this.IoTHubConnectionString   = Preconditions.CheckNonWhiteSpace(iotHubConnectionString, nameof(iotHubConnectionString));
            this.TestResultCoordinatorUrl = Preconditions.CheckNotNull(testResultCoordinatorUrl, nameof(testResultCoordinatorUrl));
            this.TrackingId     = Preconditions.CheckNonWhiteSpace(trackingId, nameof(trackingId));
            this.TargetModuleId = Preconditions.CheckNonWhiteSpace(targetModuleId, nameof(targetModuleId));

            this.TestMode               = testMode;
            this.TestStartDelay         = testStartDelay;
            this.TestDuration           = testDuration;
            this.DeploymentUpdatePeriod = deploymentUpdatePeriod;
        }