Example #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);
            }
        }
Example #2
0
        public void TestGetColumnTypeDescription_When_NameAttributeMissing()
        {
            Action act = () => _xmlConversionsReader.GetColumnTypeDescription(ConversionXmlHelper.SourceAttributeMissingForType());

            act.ShouldThrow <XmlException>().WithMessage("Error with attribute 'Name' for 'Type'");
        }