Example #1
0
 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");
 }
Example #2
0
        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");
        }