51 lines
1.9 KiB
C#

using Json2CSharpCodeGenerator.Lib;
using Json2CSharpCodeGenerator.Lib.CodeWriters;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Json2CSharpCodeGenerator.Tests;
[TestClass]
public class Test_6_DictionaryTest
{
[TestMethod]
public void Run()
{
Assert.Inconclusive(message: "This test is not yet implemented.");
return;
string path = Path.Combine(AppContext.BaseDirectory, "Test_6_DictionaryTest_INPUT.txt");
string resultPath = Path.Combine(AppContext.BaseDirectory, "Test_6_DictionaryTest_OUTPUT.txt");
string input = File.ReadAllText(path);
string errorMessage = string.Empty;
CSharpCodeWriter csharpCodeWriter = new();
JsonClassGenerator jsonClassGenerator = new()
{
CodeWriter = csharpCodeWriter
};
string returnVal = jsonClassGenerator.GenerateClasses(input, out errorMessage).ToString();
string resultsCompare = File.ReadAllText(resultPath);
Assert.AreEqual(resultsCompare.NormalizeOutput(), returnVal.NormalizeOutput());
}
[TestMethod]
public void Run2()
{
Assert.Inconclusive(message: "This test is not yet implemented.");
return;
string path = Path.Combine(AppContext.BaseDirectory, "Test_6_DictionaryTest_INPUT2.txt");
string resultPath = Path.Combine(AppContext.BaseDirectory, "Test_6_DictionaryTest_OUTPUT2.txt");
string input = File.ReadAllText(path);
string errorMessage = string.Empty;
CSharpCodeWriter csharpCodeWriter = new();
JsonClassGenerator jsonClassGenerator = new()
{
CodeWriter = csharpCodeWriter
};
string returnVal = jsonClassGenerator.GenerateClasses(input, out errorMessage).ToString();
string resultsCompare = File.ReadAllText(resultPath);
Assert.AreEqual(resultsCompare.NormalizeOutput(), returnVal.NormalizeOutput());
}
}