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); }
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); }
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); }