Beispiel #1
0
        public void GetTelemetriesTest()
        {
            string dcaRootFolder = Path.Combine(TestUtility.TestDirectory, "myDcaLocation11");

            TelemetryStoreTest.PrepareTelemetryData(dcaRootFolder);

            TelemetryStore store = new TelemetryStore(dcaRootFolder, new TraceLogger(new MockUpTraceEventProvider()));

            TelemetryCollection[] result = store.GetTelemetries();
            Assert.AreEqual(4, result.Length);
            Assert.IsTrue(result.All(p => p != null));

            Directory.Delete(dcaRootFolder, recursive: true);
        }
        public void IntegrationTest()
        {
            string dcaRootLocation = Path.Combine(TestUtility.TestDirectory, "IntegrationDca22");

            TelemetryStoreTest.PrepareTelemetryData(dcaRootLocation);

            TraceLogger   traceLogger = new TraceLogger(new MockUpTraceEventProvider());
            ProgramConfig config      = new ProgramConfig(
                ProgramParameterDefinitions.ExecutionModes.Service,
                new AppConfig(
                    new Uri("http://localhost", UriKind.Absolute),
                    dcaRootLocation,
                    TestUtility.TestDirectory + "\\Data",
                    new Uri("http://localhost", UriKind.Absolute),
                    TimeSpan.FromSeconds(300000),
                    TimeSpan.FromSeconds(2)));

            this.MockUpIntegrationTest(config, traceLogger);
            this.RealIntegrationTest(config, traceLogger);

            Directory.Delete(TestUtility.TestDirectory + "\\Data", recursive: true);
            Directory.Delete(dcaRootLocation, recursive: true);
        }