示例#1
0
        public void ConvertToJsonCamelCase_InputInValidXml_ReturnsException()
        {
            var xmlString = "wrongXML";

            TestDelegate code = () => _xmlConverter.ConvertToJsonCamelCase(xmlString);

            Assert.That(code, Throws.Exception);
        }
示例#2
0
        private void ConvertFileSystemXmlFile(ConvertModel convert)
        {
            var    data            = _fileRepository.GetFileData(((FileSystemSourceModel)convert.Source).FullPath);
            string convertedString = string.Empty;

            switch (convert.Target.TargetFileType)
            {
            case TargetFileType.Json:
                convertedString = _xmlConverter.ConvertToJson(data);
                break;

            case TargetFileType.JsonCamelCase:
                convertedString = _xmlConverter.ConvertToJsonCamelCase(data);
                break;
            }

            _fileRepository.SaveFile(convertedString, convert.Target.FullPath);
        }