Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        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());
        }