public void SerializeContainmentNavigationWithDifferentEnds()
        {
            var model = NavigationTestModelBuilder.ContainmentNavigationWithDifferentEnds();
            var csdls = NavigationTestModelBuilder.ContainmentNavigationWithDifferentEndsCsdl();

            this.SerializingValidator(model, csdls);
        }
        public void ParsingContainmentNavigationWithDifferentEndsCsdl()
        {
            var csdls = NavigationTestModelBuilder.ContainmentNavigationWithDifferentEndsCsdl();
            var model = this.GetParserResult(csdls);

            this.CheckEntityTypeNavigationCount(model, "NS.Person", 2);
            this.CheckEntityTypeNavigationCount(model, "NS.Pet", 1);
            this.CheckEntityTypeNavigationCount(model, "NS.Home", 1);

            var personNavigations = model.FindEntityType("NS.Person").NavigationProperties();
            var petNavigations    = model.FindEntityType("NS.Pet").NavigationProperties();
            var homeNavigations   = model.FindEntityType("NS.Home").NavigationProperties();

            var personToPet = personNavigations.Where(n => n.Name.Equals("ToPet")).First();

            this.CheckNavigationContainment(personToPet, true, false);
            var petToPerson = petNavigations.First();

            this.CheckNavigationsArePartners(personToPet, petToPerson);

            var personToHome = personNavigations.Where(n => n.Name.Equals("ToHome")).First();

            this.CheckNavigationContainment(personToHome, true, false);
            var homeToPerson = homeNavigations.First();

            this.CheckNavigationsArePartners(personToHome, homeToPerson);

            var container = model.EntityContainer;
            var petSet    = container.FindEntitySet("PetSet");
            var personSet = container.FindEntitySet("PersonSet");
            var homeSet   = container.FindEntitySet("HomeSet");

            Assert.AreEqual(petSet.FindNavigationTarget(petToPerson), personSet, "Invalid entity set navigation target.");

            // Contained entity set is generated dynamically.
            // Assert.AreEqual(personSet.FindNavigationTarget(personToPet), petSet, "Invalid entity set navigation target.");
            Assert.AreEqual(homeSet.FindNavigationTarget(homeToPerson), personSet, "Invalid entity set navigation target.");

            // Contained entity set is generated dynamically.
            // Assert.AreEqual(personSet.FindNavigationTarget(personToHome), homeSet, "Invalid entity set navigation target.");
        }