public void Test_16_Edit_Region()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects[0];

            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            var country = subContinent.H05_CountryObjects[0];

            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            var region = country.H07_RegionObjects.FindH08_RegionByRegion_ID(29);

            region.Region_Name += " Edited";
            region.H09_Region_SingleObject.Region_Child_Name  += " Edited";
            region.H09_Region_ASingleObject.Region_Child_Name += " Edited";
            continentColl = continentColl.Save();

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            region = country.H07_RegionObjects[0];
            Assert.AreEqual(RegionName + " Edited", region.Region_Name);
            Assert.AreEqual(RegionName + " Child" + " Edited", region.H09_Region_SingleObject.Region_Child_Name);
            Assert.AreEqual(RegionName + " ReChild" + " Edited", region.H09_Region_ASingleObject.Region_Child_Name);
        }
        public void Test_10_Delete_Country()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects[0];

            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            var country = subContinent.H05_CountryObjects[0];

            Assert.AreEqual(10, country.Country_ID);
            subContinent.H05_CountryObjects.Remove(10);
            continentColl = continentColl.Save();

            country.Country_Name = "Deleted";
            try
            {
                continentColl = continentColl.Save();
                Assert.Fail(country.Country_Name + " wasn't deleted.");
            }
            catch (Csla.DataPortalException ex)
            {
                //Assert.Fail(ex.GetBaseException().Message);
            }

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(0, subContinent.H05_CountryObjects.Count);
        }
        public void Test_11_Add_Country()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects[0];

            Assert.AreEqual(0, subContinent.H05_CountryObjects.Count);
            var country = subContinent.H05_CountryObjects.AddNew();

            country.Country_Name = CountryName;
            country.H07_Country_SingleObject.Country_Child_Name  = CountryName + " Child";
            country.H07_Country_ASingleObject.Country_Child_Name = CountryName + " ReChild";
            continentColl = continentColl.Save();

            continent = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(11, country.Country_ID);

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(CountryName, country.Country_Name);
            Assert.AreEqual(CountryName + " Child", country.H07_Country_SingleObject.Country_Child_Name);
            Assert.AreEqual(CountryName + " ReChild", country.H07_Country_ASingleObject.Country_Child_Name);
        }
        public void Test_12_Edit_Country()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects[0];

            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            var country = subContinent.H05_CountryObjects.FindH06_CountryByCountry_ID(11);

            country.Country_Name += " Edited";
            country.H07_Country_SingleObject.Country_Child_Name  += " Edited";
            country.H07_Country_ASingleObject.Country_Child_Name += " Edited";
            continentColl = continentColl.Save();

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(CountryName + " Edited", country.Country_Name);
            Assert.AreEqual(CountryName + " Child" + " Edited", country.H07_Country_SingleObject.Country_Child_Name);
            Assert.AreEqual(CountryName + " ReChild" + " Edited", country.H07_Country_ASingleObject.Country_Child_Name);
        }
        public void Test_09_Add_Country_To_Delete()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects[0];

            Assert.AreEqual(0, subContinent.H05_CountryObjects.Count);
            var country = subContinent.H05_CountryObjects.AddNew();

            country.Country_Name = CountryName;
            continentColl        = continentColl.Save();

            continent = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(10, country.Country_ID);

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(CountryName, country.Country_Name);
        }
        public void Test_07_Add_SubContinent()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(0, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects.AddNew();

            subContinent.SubContinent_Name = SubContinentName;
            subContinent.H05_SubContinent_SingleObject.SubContinent_Child_Name  = SubContinentName + " Child";
            subContinent.H05_SubContinent_ASingleObject.SubContinent_Child_Name = SubContinentName + " ReChild";
            continentColl = continentColl.Save();

            continent = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(8, subContinent.SubContinent_ID);

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(SubContinentName, subContinent.SubContinent_Name);
            Assert.AreEqual(SubContinentName + " Child", subContinent.H05_SubContinent_SingleObject.SubContinent_Child_Name);
            Assert.AreEqual(SubContinentName + " ReChild", subContinent.H05_SubContinent_ASingleObject.SubContinent_Child_Name);
        }
Exemplo n.º 7
0
        public void Test_1_Continent()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(4, continent.Continent_ID);
            Assert.AreEqual(ContinentName, continent.Continent_Name);
            Assert.AreEqual(ContinentName + " Child", continent.H03_Continent_SingleObject.Continent_Child_Name);
            Assert.AreEqual(ContinentName + " ReChild", continent.H03_Continent_ASingleObject.Continent_Child_Name);
        }
Exemplo n.º 8
0
        public void Test_2_SubContinent()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects[0];

            Assert.AreEqual(7, subContinent.SubContinent_ID);
            Assert.AreEqual(SubContinentName, subContinent.SubContinent_Name);
            Assert.AreEqual(SubContinentName + " Child", subContinent.H05_SubContinent_SingleObject.SubContinent_Child_Name);
            Assert.AreEqual(SubContinentName + " ReChild", subContinent.H05_SubContinent_ASingleObject.SubContinent_Child_Name);
        }
        public void Test_23_Add_CityRoad()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects[0];

            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            var country = subContinent.H05_CountryObjects[0];

            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            var region = country.H07_RegionObjects[0];

            Assert.AreEqual(1, region.H09_CityObjects.Count);
            var city = region.H09_CityObjects[0];

            Assert.AreEqual(0, city.H11_CityRoadObjects.Count);
            var cityRoad = city.H11_CityRoadObjects.AddNew();

            cityRoad.CityRoad_Name = CityRoadName;
            continentColl          = continentColl.Save();

            continent = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            region = country.H07_RegionObjects[0];
            Assert.AreEqual(1, region.H09_CityObjects.Count);
            city = region.H09_CityObjects[0];
            Assert.AreEqual(1, city.H11_CityRoadObjects.Count);
            cityRoad = city.H11_CityRoadObjects[0];
            Assert.AreEqual(83, cityRoad.CityRoad_ID);

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            region = country.H07_RegionObjects[0];
            Assert.AreEqual(1, region.H09_CityObjects.Count);
            city = region.H09_CityObjects[0];
            Assert.AreEqual(1, city.H11_CityRoadObjects.Count);
            cityRoad = city.H11_CityRoadObjects[0];
            Assert.AreEqual(CityRoadName, cityRoad.CityRoad_Name);
        }
        public void Test_04_Edit_Continent()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            continent.Continent_Name += " Edited";
            continent.H03_Continent_SingleObject.Continent_Child_Name  += " Edited";
            continent.H03_Continent_ASingleObject.Continent_Child_Name += " Edited";
            continentColl = continentColl.Save();

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(ContinentName + " Edited", continent.Continent_Name);
            Assert.AreEqual(ContinentName + " Child" + " Edited", continent.H03_Continent_SingleObject.Continent_Child_Name);
            Assert.AreEqual(ContinentName + " ReChild" + " Edited", continent.H03_Continent_ASingleObject.Continent_Child_Name);
        }
        public void Test_19_Add_City()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects[0];

            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            var country = subContinent.H05_CountryObjects[0];

            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            var region = country.H07_RegionObjects[0];

            Assert.AreEqual(0, region.H09_CityObjects.Count);
            var city = region.H09_CityObjects.AddNew();

            city.City_Name = CityName;
            city.H11_City_SingleObject.City_Child_Name  = CityName + " Child";
            city.H11_City_ASingleObject.City_Child_Name = CityName + " ReChild";
            continentColl = continentColl.Save();

            continent = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            region = country.H07_RegionObjects[0];
            Assert.AreEqual(1, region.H09_CityObjects.Count);
            city = region.H09_CityObjects[0];
            Assert.AreEqual(29, city.City_ID);

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            region = country.H07_RegionObjects[0];
            Assert.AreEqual(1, region.H09_CityObjects.Count);
            city = region.H09_CityObjects[0];
            Assert.AreEqual(CityName, city.City_Name);
            Assert.AreEqual(CityName + " Child", city.H11_City_SingleObject.City_Child_Name);
            Assert.AreEqual(CityName + " ReChild", city.H11_City_ASingleObject.City_Child_Name);
        }
        public void Test_22_Delete_CityRoad()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects[0];

            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            var country = subContinent.H05_CountryObjects[0];

            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            var region = country.H07_RegionObjects[0];

            Assert.AreEqual(1, region.H09_CityObjects.Count);
            var city = region.H09_CityObjects[0];

            Assert.AreEqual(1, city.H11_CityRoadObjects.Count);
            var cityRoad = city.H11_CityRoadObjects[0];

            Assert.AreEqual(82, cityRoad.CityRoad_ID);
            city.H11_CityRoadObjects.Remove(82);
            continentColl = continentColl.Save();

            cityRoad.CityRoad_Name = "Deleted";
            try
            {
                continentColl = continentColl.Save();
                Assert.Fail(cityRoad.CityRoad_Name + " wasn't deleted.");
            }
            catch (Csla.DataPortalException ex)
            {
                //Assert.Fail(ex.GetBaseException().Message);
            }

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            region = country.H07_RegionObjects[0];
            Assert.AreEqual(1, region.H09_CityObjects.Count);
            city = region.H09_CityObjects[0];
            Assert.AreEqual(0, city.H11_CityRoadObjects.Count);
        }
        public void Test_01_Create_Continent_To_Delete()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl.AddNew();

            continent.Continent_Name = ContinentName;
            continentColl            = continentColl.Save();

            Assert.AreEqual(4, continentColl.Count);
            continent = continentColl[3];
            Assert.AreEqual(4, continent.Continent_ID);

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            Assert.AreEqual(4, continentColl.Count);
            continent = continentColl[3];
            Assert.AreEqual(ContinentName, continent.Continent_Name);
        }
        public void Test_17_Add_City_To_Delete()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects[0];

            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            var country = subContinent.H05_CountryObjects[0];

            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            var region = country.H07_RegionObjects[0];

            Assert.AreEqual(0, region.H09_CityObjects.Count);
            var city = region.H09_CityObjects.AddNew();

            city.City_Name = CityName;
            continentColl  = continentColl.Save();

            continent = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            region = country.H07_RegionObjects[0];
            Assert.AreEqual(1, region.H09_CityObjects.Count);
            city = region.H09_CityObjects[0];
            Assert.AreEqual(28, city.City_ID);

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            region = country.H07_RegionObjects[0];
            Assert.AreEqual(1, region.H09_CityObjects.Count);
            city = region.H09_CityObjects[0];
            Assert.AreEqual(CityName, city.City_Name);
        }
        public void Test_03_Create_Continent()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl.AddNew();

            continent.Continent_Name = ContinentName;
            continent.H03_Continent_SingleObject.Continent_Child_Name  = ContinentName + " Child";
            continent.H03_Continent_ASingleObject.Continent_Child_Name = ContinentName + " ReChild";
            continentColl = continentColl.Save();

            continent = continentColl[3];
            Assert.AreEqual(5, continent.Continent_ID);

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(ContinentName, continent.Continent_Name);
            Assert.AreEqual(ContinentName + " Child", continent.H03_Continent_SingleObject.Continent_Child_Name);
            Assert.AreEqual(ContinentName + " ReChild", continent.H03_Continent_ASingleObject.Continent_Child_Name);
        }
Exemplo n.º 16
0
        public void Test_4_Region()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects[0];

            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            var country = subContinent.H05_CountryObjects[0];

            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            var region = country.H07_RegionObjects[0];

            Assert.AreEqual(28, region.Region_ID);
            Assert.AreEqual(RegionName, region.Region_Name);
            Assert.AreEqual(RegionName + " Child", region.H09_Region_SingleObject.Region_Child_Name);
            Assert.AreEqual(RegionName + " ReChild", region.H09_Region_ASingleObject.Region_Child_Name);
        }
        public void Test_08_Edit_SubContinent()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects.FindH04_SubContinentBySubContinent_ID(8);

            subContinent.SubContinent_Name += " Edited";
            subContinent.H05_SubContinent_SingleObject.SubContinent_Child_Name  += " Edited";
            subContinent.H05_SubContinent_ASingleObject.SubContinent_Child_Name += " Edited";
            continentColl = continentColl.Save();

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(SubContinentName + " Edited", subContinent.SubContinent_Name);
            Assert.AreEqual(SubContinentName + " Child" + " Edited", subContinent.H05_SubContinent_SingleObject.SubContinent_Child_Name);
            Assert.AreEqual(SubContinentName + " ReChild" + " Edited", subContinent.H05_SubContinent_ASingleObject.SubContinent_Child_Name);
        }
// ReSharper disable InconsistentNaming
        public void FetchTest()
        {
            var h01_ContinentColl = H01_ContinentColl.GetH01_ContinentColl();

            foreach (var h02_Continent in h01_ContinentColl)
            {
                Console.WriteLine("Continent: " + h02_Continent.Continent_Name);
                Console.WriteLine("- Person = " + h02_Continent.H03_Continent_SingleObject.Continent_Child_Name);
                Console.WriteLine("- People = " + h02_Continent.H03_Continent_ASingleObject.Continent_Child_Name);
                foreach (var h04_SubContinent in h02_Continent.H03_SubContinentObjects)
                {
                    Console.WriteLine("\tSub-continent: " + h04_SubContinent.SubContinent_Name);
                    Console.WriteLine("\t- Person = " + h04_SubContinent.H05_SubContinent_SingleObject.SubContinent_Child_Name);
                    Console.WriteLine("\t- People = " + h04_SubContinent.H05_SubContinent_ASingleObject.SubContinent_Child_Name);
                    foreach (var h06_Country in h04_SubContinent.H05_CountryObjects)
                    {
                        Console.WriteLine("\t\tCountry: " + h06_Country.Country_Name);
                        Console.WriteLine("\t\t- Person = " + h06_Country.H07_Country_SingleObject.Country_Child_Name);
                        Console.WriteLine("\t\t- People = " + h06_Country.H07_Country_ASingleObject.Country_Child_Name);
                        foreach (var h08_Region in h06_Country.H07_RegionObjects)
                        {
                            Console.WriteLine("\t\t\tRegion/State: " + h08_Region.Region_Name);
                            Console.WriteLine("\t\t\t- Person = " + h08_Region.H09_Region_SingleObject.Region_Child_Name);
                            Console.WriteLine("\t\t\t- People = " + h08_Region.H09_Region_ASingleObject.Region_Child_Name);
                            foreach (var h10_City in h08_Region.H09_CityObjects)
                            {
                                Console.WriteLine("\t\t\t\tCity: " + h10_City.City_Name);
                                Console.WriteLine("\t\t\t\t- Person = " + h10_City.H11_City_SingleObject.City_Child_Name);
                                Console.WriteLine("\t\t\t\t- People = " + h10_City.H11_City_ASingleObject.City_Child_Name);
                                foreach (var h12_CityRoad in h10_City.H11_CityRoadObjects)
                                {
                                    Console.WriteLine("\t\t\t\t\tCity: " + h12_CityRoad.CityRoad_Name);
                                }
                            }
                        }
                    }
                }
            }
        }
        public void Test_05_Add_SubContinent_To_Delete()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(0, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects.AddNew();

            subContinent.SubContinent_Name = SubContinentName;
            continentColl = continentColl.Save();

            continent = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(7, subContinent.SubContinent_ID);

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(SubContinentName, subContinent.SubContinent_Name);
        }
        public void Test_24_Edit_CityRoad()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects[0];

            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            var country = subContinent.H05_CountryObjects[0];

            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            var region = country.H07_RegionObjects[0];

            Assert.AreEqual(1, region.H09_CityObjects.Count);
            var city = region.H09_CityObjects[0];

            Assert.AreEqual(1, city.H11_CityRoadObjects.Count);
            var cityRoad = city.H11_CityRoadObjects[0];

            cityRoad.CityRoad_Name += " Edited";
            continentColl           = continentColl.Save();

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            region = country.H07_RegionObjects[0];
            Assert.AreEqual(1, region.H09_CityObjects.Count);
            city = region.H09_CityObjects[0];
            Assert.AreEqual(1, city.H11_CityRoadObjects.Count);
            cityRoad = city.H11_CityRoadObjects[0];
            Assert.AreEqual(CityRoadName + " Edited", cityRoad.CityRoad_Name);
        }
        public void Test_02_Delete_Continent()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(4, continent.Continent_ID);
            continentColl.Remove(4);
            continentColl = continentColl.Save();

            continent.Continent_Name = "Deleted";
            try
            {
                continentColl = continentColl.Save();
                Assert.Fail(continent.Continent_Name + " wasn't deleted.");
            }
            catch (Csla.DataPortalException ex)
            {
                //Assert.Fail(ex.GetBaseException().Message);
            }

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl.FindH02_ContinentByContinent_ID(4);
            Assert.IsNull(continent);
        }
        public void Test_20_Edit_City()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects[0];

            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            var country = subContinent.H05_CountryObjects[0];

            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            var region = country.H07_RegionObjects[0];

            Assert.AreEqual(1, region.H09_CityObjects.Count);
            var city = region.H09_CityObjects.FindH10_CityByCity_ID(29);

            city.City_Name += " Edited";
            city.H11_City_SingleObject.City_Child_Name  += " Edited";
            city.H11_City_ASingleObject.City_Child_Name += " Edited";
            continentColl = continentColl.Save();

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            region = country.H07_RegionObjects[0];
            Assert.AreEqual(1, region.H09_CityObjects.Count);
            city = region.H09_CityObjects[0];
            Assert.AreEqual(CityName + " Edited", city.City_Name);
            Assert.AreEqual(CityName + " Child" + " Edited", city.H11_City_SingleObject.City_Child_Name);
            Assert.AreEqual(CityName + " ReChild" + " Edited", city.H11_City_ASingleObject.City_Child_Name);
        }
        public void Test_13_Add_Region_To_Delete()
        {
            var continentColl = H01_ContinentColl.GetH01_ContinentColl();
            var continent     = continentColl[3];

            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            var subContinent = continent.H03_SubContinentObjects[0];

            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            var country = subContinent.H05_CountryObjects[0];

            Assert.AreEqual(0, country.H07_RegionObjects.Count);
            var region = country.H07_RegionObjects.AddNew();

            region.Region_Name = RegionName;
            continentColl      = continentColl.Save();

            continent = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            region = country.H07_RegionObjects[0];
            Assert.AreEqual(28, region.Region_ID);

            continentColl = H01_ContinentColl.GetH01_ContinentColl();
            continent     = continentColl[3];
            Assert.AreEqual(1, continent.H03_SubContinentObjects.Count);
            subContinent = continent.H03_SubContinentObjects[0];
            Assert.AreEqual(1, subContinent.H05_CountryObjects.Count);
            country = subContinent.H05_CountryObjects[0];
            Assert.AreEqual(1, country.H07_RegionObjects.Count);
            region = country.H07_RegionObjects[0];
            Assert.AreEqual(RegionName, region.Region_Name);
        }