示例#1
0
        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);
            }
        }
示例#2
0
        public void TestGetRootNode_When_IllegalXml()
        {
            Action act = () => _xmlConversionsReader.GetRootNode("<illegal xml>");

            act.ShouldThrow <XmlException>().WithMessage("Error when reading conversion XML");
        }