public void CreateNewRepositoryAndReadIt()
        {
            if(File.Exists(TestConstants.RAMDISK + "\\logs.xml"))
                File.Delete(TestConstants.RAMDISK + "\\logs.xml");
            TelemetryRepository repo = new TelemetryRepository(TestConstants.RAMDISK + "\\logs.xml");

            Assert.AreEqual(0, repo.GetAll().Count());

            repo.Add(new TelemetryLog(1, "test/test.zip"));

            Assert.AreEqual(1, repo.GetAll().Count());

            repo.Export();

            TelemetryRepository repo2 = new TelemetryRepository(TestConstants.RAMDISK + "\\logs.xml");
            Assert.AreEqual(1, repo2.GetAll().Count());
        }
Esempio n. 2
0
        public void CreateNewRepositoryAndReadIt()
        {
            if (File.Exists(TestConstants.RAMDISK + "\\logs.xml"))
            {
                File.Delete(TestConstants.RAMDISK + "\\logs.xml");
            }
            TelemetryRepository repo = new TelemetryRepository(TestConstants.RAMDISK + "\\logs.xml");

            Assert.AreEqual(0, repo.GetAll().Count());

            repo.Add(new TelemetryLog(1, "test/test.zip"));

            Assert.AreEqual(1, repo.GetAll().Count());

            repo.Export();

            TelemetryRepository repo2 = new TelemetryRepository(TestConstants.RAMDISK + "\\logs.xml");

            Assert.AreEqual(1, repo2.GetAll().Count());
        }