Beispiel #1
0
        public void TestCreateString_WithNull()
        {
            var    key    = "MyString";
            string value  = null;
            var    result = XmlValue.CreateString(key, value);

            Assert.AreEqual(key, result.NodeName);
            Assert.AreEqual(value, result.Value);
            Assert.AreEqual(XmlValueType.String, result.ValueType);
        }
Beispiel #2
0
        public void TestSetNilString()
        {
            var key   = "MyString";
            var key2  = "MyString2";
            var value = "my string";

            var result = XmlValue.CreateString(key, value) as XmlString;

            Assert.IsFalse(result.IsNil);

            var result2 = XmlValue.CreateString(key2, null) as XmlString;

            Assert.IsTrue(result2.IsNil);
        }
Beispiel #3
0
        public void TestArrayOfString_WithNull()
        {
            var service = this.GetService();

            var values = new string[] { "a", null };

            var result = service.GetRoot(new XmlArray("ArrayOfString").Add(new XmlString("String", values[0])).Add(XmlValue.CreateString("String", values[1])));

            Assert.AreEqual("<ArrayOfString xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><String>a</String><String xsi:nil=\"true\" /></ArrayOfString>", result);
        }