public void GetAll_NotCachedObject_ShouldUpdateCache() { var book = new Book(); BookRepository.Save(book); var version = new BookVersion { BookId = book.Id }; NoCachedBookVersionRepository.Save(version); version = BookVersionRepository.GetAll().First(); var result = BookVersionRepository.GetAll(); Assert.AreEqual(version, result.First()); }
public void GetAll_NotCachedObject_ShouldReturnInstanceFromDb() { var book = new Book(); BookRepository.Save(book); var version = new BookVersion { BookId = book.Id }; NoCachedBookVersionRepository.Save(version); var result = BookVersionRepository.GetAll(); Assert.AreNotSame(version, result.First()); Assert.AreEqual(version, result.First()); }