public void TestLogResource() { var person = new PersonEntity(); person.Load(new Hashtable { { "id", 2 } }); var resource = new LogResource(); resource.SetPerson(person); var result = resource.Build(); Assert.That(resource.GetCount() == 1); Assert.That(resource.GetCountTotal() == 1); Assert.That(result[0].Action == "register"); }
/// <summary> /// Get all log entities in the database /// concerning this person. /// </summary> /// <returns>All the logs in the database concerning this person.</returns> public List<LogEntity> GetLogs() { if (Exists()) { var resource = new LogResource(); resource.SetPerson(this); resource.SetOrder("timestamp", "desc"); logs = resource.Build(); } return logs; }