private void RealIntegrationTest(ProgramConfig config, TraceLogger traceLogger) { TelemetryServicelet server = new TelemetryServicelet(config, traceLogger); server.Start(); // ensure that the telemetry data have been uploaded at least twice Thread.Sleep(10000); Assert.IsTrue(server.Cookie.LastProcessedUtc > DateTime.UtcNow - TimeSpan.FromSeconds(5)); Assert.AreEqual(4, server.Cookie.TelemetriesLastUploaded); server.Stop(); }
private void MockUpIntegrationTest(ProgramConfig config, TraceLogger traceLogger) { MockUpTelemetryUploader uploader = new MockUpTelemetryUploader(); TelemetryServicelet server = new TelemetryServicelet(config, traceLogger, uploader); server.Start(); // ensure that the telemetry data have been uploaded at least twice Thread.Sleep(10000); Assert.IsTrue(uploader.TelemetriesUploaded > 8); Assert.IsTrue(server.Cookie.LastProcessedUtc > DateTime.UtcNow - TimeSpan.FromSeconds(5)); Assert.AreEqual(4, server.Cookie.TelemetriesLastUploaded); server.Stop(); int originalUploaded = uploader.TelemetriesUploaded; Thread.Sleep(5000); Assert.AreEqual(originalUploaded, uploader.TelemetriesUploaded); }