public void ShouldOnlyContainOneTextAttribute() { var obj = new ShouldThrowError(); bool errorThrown = false; try { var result = XmlSerializer<ShouldThrowError>.New().SerializeToString(obj); } catch (Exception ex) { errorThrown = true; } Assert.IsTrue(errorThrown, "There should be an error when there are multiple TextAttributes"); }
public void ShouldOnlyContainOneTextAttribute() { var obj = new ShouldThrowError(); bool errorThrown = false; try { var result = XmlSerializer <ShouldThrowError> .New().SerializeToString(obj); } catch (Exception ex) { errorThrown = true; } Assert.IsTrue(errorThrown, "There should be an error when there are multiple TextAttributes"); }