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

DeletingAllObjectsOfATypeLeavesObjectOfInheritingTypes() private method

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

            Dictionary<Type, Dictionary<string, string>> adict = new Dictionary<Type, Dictionary<string, string>>();

            1.Through(4).ForEach(num =>
            {
                var user = new User() { Id = Guid.NewGuid() };
                store.Add(user.Id, user, adict);
            });

            1.Through(4).ForEach(num =>
            {
                var person = new Person() { Id = Guid.NewGuid() };
                store.Add(person.Id, person, adict);
            });

            store.GetAll<User>().Should().HaveCount(4);
            store.GetAll<Person>().Should().HaveCount(8); //User inherits person

            store.RemoveAll<Person>().Should().Be(4);

            store.GetAll<User>().Should().HaveCount(4);

            store.GetAll<Person>().Should().HaveCount(4);

        }
    }
DocumentDbTests