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"); }
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"); }