public void SetUp() { filename = Path.GetTempFileName(); db = new TestRunInformationDatabase(filename); db.AddNewEntries(new[] { TestData.BuildTestInformatonFor("Test1", "test") }); db.AddNewEntries(new[] { TestData.BuildTestInformatonFor("Test1", "test") }); }
public void a_corrupted_database_exception_is_thrown() { filename = Path.GetTempFileName(); db = new TestRunInformationDatabase(filename); db.AddNewEntries(new[] { TestData.BuildTestInformatonFor("Test1", "test") }); db.AddNewEntries(new[] { TestData.BuildTestInformatonFor("Test2", "test") }); db.AddNewEntries(new[] { TestData.BuildTestInformatonFor("Test3", "test") }); db.TakeSnapshot(); File.Delete(filename + ".idx"); db = new TestRunInformationDatabase(filename); db.LoadWithSnapshot(); }
public void a_corrupted_database_exception_is_thrown() { filename = Path.GetTempFileName(); db = new TestRunInformationDatabase(filename); db.AddNewEntries(new[] { TestData.BuildTestInformatonFor("Test1", "test") }); db.AddNewEntries(new[] { TestData.BuildTestInformatonFor("Test2", "test") }); db.AddNewEntries(new[] { TestData.BuildTestInformatonFor("Test3", "test") }); db.TakeSnapshot(); File.Delete(filename + ".idx"); File.Copy(filename, filename + ".idx"); //copying original profiler db over the top should cause some issues db = new TestRunInformationDatabase(filename); db.LoadWithSnapshot(); }
public void UpdateInfo(string filename, ITestInformationEnricher enricher) { try { if (Monitor.TryEnter(_lock, 5000)) { try { using (var f = File.Open(filename, FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read)) { enricher.ClearCache(); var items = enricher.Enrich(_parser.Parse(f)); items = Printall(items); var infos = _assembler.Assemble(items); //var infos2 = printInfos(infos); _database.AddNewEntries(infos); _database.TakeSnapshot(); enricher.ClearCache(); } } finally { Monitor.Exit(_lock); } } } catch (Exception ex) { throw ex; } }
public void SetUp() { filename = Path.GetTempFileName(); db = new TestRunInformationDatabase(filename); projection = new TestProjection(); db.AddNewEntries(new[] { TestData.BuildTestInformatonFor("Test1", "test") }); db.AttachProjection(projection); db.RemoveEntryIfExist("Test1"); }