private static string ReadActual(this TestSolution solution) => solution.ReadFile("representation.txt").NormalizeWhiteSpace();
public void SolutionIsRepresentedCorrectly(TestSolution solution) { var(representation, mapping) = TestSolutionRepresenter.Run(solution); Assert.Equal(representation.Expected, representation.Actual); Assert.Equal(mapping.Expected, mapping.Actual); }
private static string ReadFile(this TestSolution solution, string fileName) => File.ReadAllText(Path.Combine(solution.Directory, fileName));
public static TestSolutionRepresentation Read(TestSolution solution) => new TestSolutionRepresentation(solution.ReadExpected(), solution.ReadActual());
private static string ReadExpected(this TestSolution solution) => solution.ReadFile("expected_representation.txt").NormalizeWhiteSpace();
public static TestSolutionMapping Read(TestSolution solution) => new TestSolutionMapping(solution.ReadExpected(), solution.ReadActual());
private static Dictionary <string, string> ReadMapping(this TestSolution solution, string fileName) => JsonSerializer.Deserialize <Dictionary <string, string> >(solution.ReadFile(fileName));
private static Dictionary <string, string> ReadExpected(this TestSolution solution) => solution.ReadMapping("expected_mapping.json");
private static Dictionary <string, string> ReadActual(this TestSolution solution) => solution.ReadMapping("mapping.json");