Exemplo n.º 1
0
        public void SerializeTestNullGroup()
        {
            Group  group    = null;
            string expected = string.Empty;
            string actual;

            actual = GroupExtensions.Serialize(group);
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public void SerializeTest()
        {
            Group parent = new Group("Sun", GroupType.ReferenceFrame, null);
            Group group  = new Group("Earth", GroupType.ReferenceFrame, parent);

            string expected = "<?xml version=\"1.0\" encoding=\"utf-16\"?><Group xmlns:d1p1=\"http://schemas.datacontract.org/2004/07/Microsoft.Research.Wwt.Excel.Common\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"Microsoft.Research.Wwt.Excel.Common\"><d1p1:GroupType>ReferenceFrame</d1p1:GroupType><d1p1:Name>Earth</d1p1:Name><d1p1:Parent><d1p1:GroupType>ReferenceFrame</d1p1:GroupType><d1p1:Name>Sun</d1p1:Name><d1p1:Parent i:nil=\"true\" /><d1p1:Path>/Sun</d1p1:Path></d1p1:Parent><d1p1:Path>/Sun/Earth</d1p1:Path></Group>";
            string actual;

            actual = GroupExtensions.Serialize(group);
            Assert.AreEqual(expected, actual);
        }