public void InsertTest() { const int cacheId = 499; const int creatorId = 32; LogEntry toInsert = new LogEntry(-1, cacheId, creatorId, new DateTime(2009, 12, 6), false, "not so fantastic"); target.Insert(toInsert); LogEntry expected = target.GetById(toInsert.Id); Assert.AreEqual(expected, toInsert); Assert.AreEqual(expected.CreationDate, toInsert.CreationDate); DeleteLogEntry(toInsert.Id); // internal method, not available in DaoInterface Assert.IsNull(target.GetById(toInsert.Id)); }
public bool AddLogEntryForCache(LogEntry entry) { ValidateLogEntry(entry); return(logEntryDao.Insert(entry) > 0); }