public void CreateMultiReferenceObjects()
        {
            var document = XDocument.Parse(Resources.MultiReference);

            foreach (XElement element in document.Descendants(typeof(Children).Name))
            {
                DataStoreObject<Children> dataStoreObject = new ChildrenDataStore();
                var children = dataStoreObject.CreateObject(element);

                Assert.AreEqual(children.ChildOne.Father, children.ChildTwo.Father);
                Assert.AreEqual(children.ChildOne.Mother, children.ChildTwo.Mother);
            }
        }
        public void CreateXElementMultipleReferenceDataTypes()
        {
            var father = new Person()
            {
                Name = "Father",
                Birthday = new DateTime(1970, 7, 7),
                Height = 180,
                Weight = 80
            };

            var mother = new Person()
            {
                Name = "Mother",
                Birthday = new DateTime(1975, 7, 7),
                Height = 175,
                Weight = 72
            };

            var child = new Child()
            {
                Father = father,
                Mother = mother
            };

            var child2 = new Child()
            {
                Father = father,
                Mother = mother
            };

            var children = new Children()
            {
                ChildOne = child,
                ChildTwo = child2
            };

            var expectedFather = new XElement("Person");
            expectedFather.SetElementValue("Name", "Father");
            expectedFather.SetElementValue("Birthday", "1970-07-07T00:00:00");
            expectedFather.SetElementValue("Weight", "80");
            expectedFather.SetElementValue("Height", "180");

            var expectedMother = new XElement("Person");
            expectedMother.SetElementValue("Name", "Mother");
            expectedMother.SetElementValue("Birthday", "1975-07-07T00:00:00");
            expectedMother.SetElementValue("Weight", "72");
            expectedMother.SetElementValue("Height", "175");

            var expectedChild1 = new XElement("ChildOne", expectedFather, expectedMother);
            var expectedChild2 = new XElement("ChildTwo", expectedFather, expectedMother);
            var expectedChildren = new XElement("Children", expectedChild1, expectedChild2);

            var dataStore = new ChildrenDataStore();
            var actualElement = dataStore.CreateXElement(children);

            var guid = actualElement.GetGuid();
            expectedChildren.SetAttributeValue("ref", guid);

            guid = actualElement.Elements().ElementAt(0).GetGuid();
            expectedChild1.SetAttributeValue("ref", guid);

            guid = actualElement.Elements().ElementAt(1).GetGuid();
            expectedChild2.SetAttributeValue("ref", guid);

            guid = actualElement.Elements().ElementAt(0).Elements().ElementAt(0).GetGuid();
            expectedFather.SetAttributeValue("ref", guid);

            guid = actualElement.Elements().ElementAt(0).Elements().ElementAt(1).GetGuid();
            expectedMother.SetAttributeValue("ref", guid);

            Assert.AreEqual(expectedChildren.Value, actualElement.Value);
        }