public void InsertLojackAuditProcessTest() { var rep = new LojackAuditProcessRepository(new LojackContext()); var audit = new LojackAuditProcess { FileName = "test.csv", ModificationDate = DateTime.Now, ProcessDateTime = DateTime.Now, RecordsProcessed = 10, Status = "Fine" }; var record = rep.Insert(audit); Assert.IsTrue(record.LojackAuditProcessId > 0); }
public void GetLojackAuditProcessTest() { var rep = new LojackAuditProcessRepository(new LojackContext()); var audit = new LojackAuditProcess { FileName = "test.csv", ModificationDate = DateTime.Now, ProcessDateTime = DateTime.Now, RecordsProcessed = 10, TotalRecords = 100, Status = "Tested" }; var record = rep.Insert(audit); var found = rep.FindByFileName(record.FileName); Assert.IsTrue(found); found = rep.FindByFileName("notfound.csv"); Assert.IsFalse(found); }
private static void InsertLojackAuditRecord(string file, int counter, int totalRecords) { using (var db = new LojackContext()) { var rep = new LojackAuditProcessRepository(db); var lojack = new LojackAuditProcess { FileName = file, ModificationDate = DateTime.Now, ProcessDateTime = DateTime.Now, RecordsProcessed = counter, TotalRecords = totalRecords, Status = "Processed" }; rep.Insert(lojack); } }