public void GetAllReference_SavedObject_ShouldReturnCachedObject() { var book = new Book(); BookRepository.Save(book); var version = new BookVersion { BookId = book.Id }; BookVersionRepository.Save(version); var result = BookVersionRepository.GetAllReference <Book>(book.Id); Assert.AreSame(version, result.First()); }
public void GetAllReference_NotCachedObject_ShouldUpdateCache() { var book = new Book(); BookRepository.Save(book); var version = new BookVersion { BookId = book.Id }; NoCachedBookVersionRepository.Save(version); version = BookVersionRepository.GetAllReference <Book>(book.Id).First(); var result = BookVersionRepository.GetAllReference <Book>(book.Id); Assert.AreEqual(version, result.First()); }