public void InnerTextDerivedShouldThrowError()
 {
     bool gotException = false;
     try
     {
         XmlTextDerivedShouldThrowError test = new XmlTextDerivedShouldThrowError() { ThisShouldBeInner = "test" };
         var result = XmlSerializer<XmlTextDerivedShouldThrowError>.New().SerializeToString(test);
     }
     catch (Exception)
     {
         gotException = true;
     }
     Assert.IsTrue(gotException, "Only one innertext is allowed");
 }
Exemple #2
0
        public void InnerTextDerivedShouldThrowError()
        {
            bool gotException = false;

            try
            {
                XmlTextDerivedShouldThrowError test = new XmlTextDerivedShouldThrowError()
                {
                    ThisShouldBeInner = "test"
                };
                var result = XmlSerializer <XmlTextDerivedShouldThrowError> .New().SerializeToString(test);
            }
            catch (Exception)
            {
                gotException = true;
            }
            Assert.IsTrue(gotException, "Only one innertext is allowed");
        }