CQRS.Tests.KeyValueStorage.DocumentDbTests.GetAllWithIdsReturnsTheSameInstanceForAnyPreviouslyFetchedDocuments C# (CSharp) Method

GetAllWithIdsReturnsTheSameInstanceForAnyPreviouslyFetchedDocuments() private method

        public void GetAllWithIdsReturnsTheSameInstanceForAnyPreviouslyFetchedDocuments()
        {
            var store = CreateStore();

            var ids = 1.Through(9).Select(index => Guid.Parse("00000000-0000-0000-0000-00000000000{0}".FormatWith(index))).ToArray();

            var users = ids.Select(id => new User() { Id = id }).ToArray();

            using (var session = OpenSession(store))
            {
                users.ForEach(user => session.Save(user));
                session.SaveChanges();
            }

            using (var session = OpenSession(store))
            {
                var fetchedIndividually = ids.Select(id => session.Get<User>(id)).ToArray();
                var fetchedWithGetAll = session.Get<User>(ids).ToArray();

                fetchedIndividually.ForEach((user, index) => Assert.That(user, Is.SameAs(fetchedWithGetAll[index])));
            }
        }
DocumentDbTests