public void ConvertToXml_InputValidJson_ReturnsTrue()
        {
            var jsonString = @"{
                              '@Id': 1,
                              'Email': '*****@*****.**',
                              'Active': true,
                              'CreatedDate': '2013-01-20T00:00:00Z',
                              'Roles': [
                                'User',
                                'Admin'
                              ],
                              'Team': {
                                '@Id': 2,
                                'Name': 'Software Developers',
                                'Description': 'Creators of fine software products and services.'
                              }
                            }";

            var result = _jsonConverter.ConvertToXml(jsonString);

            Assert.IsNotEmpty(result, "Result shouldn't be empty.");
        }
Esempio n. 2
0
        private void ConvertFileSystemJsonFile(ConvertModel convert)
        {
            var    data            = _fileRepository.GetFileData(((FileSystemSourceModel)convert.Source).FullPath);
            string convertedString = string.Empty;

            switch (convert.Target.TargetFileType)
            {
            case TargetFileType.Xml:
                convertedString = _jsonConverter.ConvertToXml(data);
                break;
            }

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