public void Test_Append_Decimals_M7() { XmlDocument doc = new XmlDocument(); XmlElement elem = doc.CreateElement( "test" ); doc.AppendChild( elem ); PrecisionProperty pp = new PrecisionProperty( PrecisionProperty.PrecisionTypeCode.Decimals, -7 ); elem.Attributes.Append( pp.CreateAttribute( doc ) ); string expectedXML = @"<?xml version=""1.0"" encoding=""utf-16""?> <test decimals=""-7"" />"; System.IO.StringWriter writer = new System.IO.StringWriter(); doc.Save( writer ); Assert.AreEqual( expectedXML, writer.ToString() ); }
[Test] public void Test_Append_INF_3() { XmlDocument doc = new XmlDocument(); XmlElement elem = doc.CreateElement("test"); doc.AppendChild(elem); PrecisionProperty pp = new PrecisionProperty(PrecisionProperty.PrecisionTypeCode.Precision, 3); elem.Attributes.Append(pp.CreateAttribute(doc)); string expectedXML = @"<?xml version=""1.0"" encoding=""utf-16""?> <test precision=""3"" />"; System.IO.StringWriter writer = new System.IO.StringWriter(); doc.Save(writer); Assert.AreEqual(expectedXML, writer.ToString()); }
set => this.SetValue(PrecisionProperty, value);