public void Initialize(string conversionXml) { try { var rootNode = _xmlConversionsReader.GetRootNode(conversionXml); FromSystem = _xmlConversionsReader.GetSourceSystem(rootNode); ToSystem = _xmlConversionsReader.GetDestinationSystem(rootNode); foreach (XmlNode typeNode in rootNode.ChildNodes) { if (typeNode.NodeType == XmlNodeType.Comment) { continue; } var typeDescription = _xmlConversionsReader.GetColumnTypeDescription(typeNode); _types.Add(typeDescription); } } catch (Exception ex) { if (ex is AColumnTypeException) { throw; } throw new AColumnTypeException("Error when reading conversion XML", ex); } }
public void TestGetRootNode_When_IllegalXml() { Action act = () => _xmlConversionsReader.GetRootNode("<illegal xml>"); act.ShouldThrow <XmlException>().WithMessage("Error when reading conversion XML"); }