how do you mock an xml for unit testing?
问题 I need to unit testing this GetData method. public MessageResponse GetData(XmlElement requestElement) { MessageResponse MsgResponse = new MessageResponse(); if (requestElement.Attributes["employeeNo"] == null){ MsgResponse.Messages = new List<string>(); MsgResponse.Messages.Add("Attribute employeeNo is missing"); MsgResponse.Error = true; return MsgResponse; } if (requestElement.Attributes["xmlEmployeeName"] == null){ MsgResponse.Messages.Add("Attribute xmlEmployeeName is missing");