json-2-c-sharp-code-generator/Json2CSharpCodeGenerator.Tests/Test_18_WRONG_NAME_RECURSIVE_BUG78.cs

27 lines
1.1 KiB
C#

using Json2CSharpCodeGenerator.Lib;
using Json2CSharpCodeGenerator.Lib.CodeWriters;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Json2CSharpCodeGenerator.Tests;
[TestClass]
public class Test_18_WRONG_NAME_RECURSIVE_BUG78
{
[TestMethod]
public void Run()
{
string path = Path.Combine(AppContext.BaseDirectory, "Test_18_WRONG_NAME_RECURSIVE_BUG78_INPUT.txt");
string resultPath = Path.Combine(AppContext.BaseDirectory, "Test_18_WRONG_NAME_RECURSIVE_BUG78_OUTPUT.txt");
string input = File.ReadAllText(path);
CSharpCodeWriter csharpCodeWriter = new();
JsonClassGenerator jsonClassGenerator = new()
{
CodeWriter = csharpCodeWriter
};
string returnVal = jsonClassGenerator.GenerateClasses(input, out _).ToString();
string resultsCompare = File.ReadAllText(resultPath);
Assert.AreEqual(resultsCompare.Replace(Environment.NewLine, "").Replace(" ", "").Replace("\t", ""), returnVal.Replace(Environment.NewLine, "").Replace(" ", "").Replace("\t", ""));
}
}