Ejemplo n.º 1
0
        public void Test_FromXml_SharesWithNoNamespace()
        {
            TestMeasure tm = new TestMeasure();

            tm.MeasureValue     = "shares";
            tm.MeasureNamespace = "";
            tm.MeasureSchema    = "http://www.xbrl.org/2003/instance";

            XmlDocument doc = new XmlDocument();
            // set the default namespace for the root, since the element doesn't have a namespace
            XmlElement root = doc.CreateElement("xbrl", "http://www.xbrl.org/2003/instance");

            doc.AppendChild(root);
            XmlNode elem = tm.CreateElement(doc, root, false);

            ArrayList errors = null;
            Measure   mBack  = new Measure();

            Assert.IsTrue(Measure.TryCreateFromXml(elem, ref mBack, ref errors), errors.Count > 0 ? ((ParserMessage)errors[0]).Message : string.Empty);

            Assert.IsTrue(tm.Equals(mBack), "objects don't match");
        }
Ejemplo n.º 2
0
        public void Test_FromXml_4217_Element()
        {
            TestMeasure tm = new TestMeasure();

            tm.MeasureValue     = "USD";
            tm.MeasureNamespace = "iso4217";
            tm.MeasureSchema    = "http://www.xbrl.org/2003/iso4217";

            XmlDocument doc = new XmlDocument();

            XmlElement root = doc.CreateElement("xbrl");

            doc.AppendChild(root);
            XmlNode elem = tm.CreateElement(doc, root, false);

            ArrayList errors = null;

            Measure mBack = new Measure();

            Assert.IsTrue(Measure.TryCreateFromXml(elem, ref mBack, ref errors), errors.Count > 0 ? ((ParserMessage)errors[0]).Message : string.Empty);

            Assert.IsTrue(tm.Equals(mBack), "objects don't match");
        }
Ejemplo n.º 3
0
        public void Test_FromXml_SharesWithNoNamespace()
        {
            TestMeasure tm = new TestMeasure();
            tm.MeasureValue = "shares";
            tm.MeasureNamespace = "";
            tm.MeasureSchema = "http://www.xbrl.org/2003/instance";

            XmlDocument doc = new XmlDocument();
            // set the default namespace for the root, since the element doesn't have a namespace
            XmlElement root = doc.CreateElement( "xbrl", "http://www.xbrl.org/2003/instance");
            doc.AppendChild( root );
            XmlNode elem = tm.CreateElement( doc, root, false );

            ArrayList errors = null;
            Measure mBack = new Measure();

            Assert.IsTrue( Measure.TryCreateFromXml( elem, ref mBack, ref errors  ), errors.Count > 0 ? ((ParserMessage)errors[0]).Message : string.Empty );

            Assert.IsTrue( tm.Equals( mBack ), "objects don't match" );
        }
Ejemplo n.º 4
0
        public void Test_FromXml_4217_Element()
        {
            TestMeasure tm = new TestMeasure();
            tm.MeasureValue = "USD";
            tm.MeasureNamespace = "iso4217";
            tm.MeasureSchema = "http://www.xbrl.org/2003/iso4217";

            XmlDocument doc = new XmlDocument();

            XmlElement root = doc.CreateElement( "xbrl" );
            doc.AppendChild( root );
            XmlNode elem = tm.CreateElement( doc, root, false );

            ArrayList errors = null;

            Measure mBack = new Measure();

            Assert.IsTrue( Measure.TryCreateFromXml( elem, ref mBack, ref errors  ), errors.Count > 0 ? ((ParserMessage)errors[0]).Message : string.Empty );

            Assert.IsTrue( tm.Equals( mBack ), "objects don't match" );
        }