/*global exports: false, require: false */ /*jslint plusplus: false */ "use strict"; var xrpc = require("xmlrpc"); var xmlOut = "\n" + "\nbugzilla.updateAttachMimeType\n" + "\n\n\n\nattach_id\n" + "myId\n\n\n" + "mime_type\ntext/plain\n\n" + "\nnomail\nbillg@microsoft.com" + "\n\n\n\n\n\n" + "me@example.com\n\n" + "\nsecret\n\n" + "\n3.14\n\n" + "\n1\n\n" + "\n"; // testing xrpc.XMLRPCMessage exports.ensureGenerateXMLRPC = function (test) { var msg = new xrpc.XMLRPCMessage("bugzilla.updateAttachMimeType"); msg.addParameter({ 'attach_id' : "myId", 'mime_type' : "text/plain", 'nomail' : "billg@microsoft.com" }); msg.addParameter("me@example.com"); msg.addParameter("secret"); msg.addParameter(3.14); msg.addParameter(true); test.assertEqual(msg.xml(), xmlOut, "generate XML-RPC message"); };