public void CachesAndAnswersCanBeSavedToTheDatabase() { var cache = new Cache { Answers = new List <Answer> { sampleAnswer, anotherAnswer } }; repo.Save(cache); repo.Commit(); var assertCache = assertContext.Caches.Include(x => x.Answers).First(x => x.Id == cache.Id); Assert.NotNull(assertCache.Id); Assert.Equal(2, assertCache.Answers.Count); var first = assertCache.Answers.First(x => x.Id == sampleAnswer.Id); var second = assertCache.Answers.First(x => x.Id == anotherAnswer.Id); AssertAnswer(sampleAnswer, first); AssertAnswer(anotherAnswer, second); }