public TestResultReportingService(ITestOperationResultStorage storage) { this.storage = Preconditions.CheckNotNull(storage, nameof(storage)); switch (Settings.Current.TestMode) { case TestMode.Connectivity: { ConnectivitySpecificSettings connectivitySettings = Settings.Current.ConnectivitySpecificSettings.Expect(() => new ArgumentException("ConnectivitySpecificSettings must be supplied.")); this.delayBeforeWork = Settings.Current.TestStartDelay + connectivitySettings.TestDuration + connectivitySettings.TestVerificationDelay; // Set sendReportFrequency to -1ms to indicate that the sending report Timer won't repeat this.sendReportFrequency = TimeSpan.FromMilliseconds(-1); this.logUploadDuration = Option.None <TimeSpan>(); break; } case TestMode.LongHaul: { // In long haul mode, wait 1 report frequency before starting this.sendReportFrequency = Settings.Current.LongHaulSpecificSettings .Expect(() => new ArgumentException("LongHaulSpecificSettings must be supplied.")) .SendReportFrequency; this.delayBeforeWork = this.sendReportFrequency; // Add 10 minute buffer to duration to ensure we capture all logs this.logUploadDuration = Option.Some(this.sendReportFrequency + TimeSpan.FromMinutes(10)); break; } } this.serviceSpecificSettings = Settings.Current.TestResultReportingServiceSettings.Expect(() => new ArgumentException("TestResultReportingServiceSettings must be supplied.")); }
public TestResultReportingService(ITestOperationResultStorage storage) { this.storage = Preconditions.CheckNotNull(storage, nameof(storage)); this.delayBeforeWork = Settings.Current.TestStartDelay + Settings.Current.TestDuration + Settings.Current.DurationBeforeVerification; this.serviceSpecificSettings = Settings.Current.TestResultReportingServiceSettings.Expect(() => new ArgumentException("TestResultReportingServiceSettings must be supplied.")); }