コード例 #1
0
        public void Xml_contains_no_fluff()
        {
            var notice = new TestNotice
                             {
                                 ApiKey = "123456",
                                 Version = "2.0"
                             };

            var serializer = new CleanXmlSerializer<TestNotice>();
            string xml = serializer.ToXml(notice);

            const string expected = @"<notice version=""2.0""><api-key>123456</api-key></notice>";
            Assert.AreEqual(expected, xml);
        }
コード例 #2
0
ファイル: XmlGeneration.cs プロジェクト: friism/SharpBrake
        public void Xml_contains_no_fluff()
        {
            var notice = new TestNotice
            {
                ApiKey  = "123456",
                Version = "2.0"
            };

            var    serializer = new CleanXmlSerializer <TestNotice>();
            string xml        = serializer.ToXml(notice);

            const string expected = @"<notice version=""2.0"">
  <api-key>123456</api-key>
</notice>";

            Assert.AreEqual(expected, xml);
        }