public void AddNode_NullObjects_ShouldWork() { // Arrange using (var workbook = this.ExcelApplication.Workbooks.Add()) { CustomXMLPart cxp1 = workbook.CustomXMLParts.Add("<invoice />"); CustomXMLNode cxn = cxp1.SelectSingleNode("/invoice"); // Act Assert.Throws <MethodCOMException>(() => cxp1.AddNode(cxn, null, null, null, null, null)); // Assert // Assert.AreEqual(@"<invoice><upccode xmlns=""urn: invoice:namespace""/></invoice>", cxp1.XML); } }