From 62566dc82ac69eca99ca07f52aea7c4eff10d9ae Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Fri, 31 Jan 2025 17:27:19 -0300 Subject: [PATCH] Use source sample files in tests Rather than copy-local unnecessary. --- src/Tests/Misc.cs | 16 +++++++++------- src/Tests/Tests.csproj | 3 ++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Tests/Misc.cs b/src/Tests/Misc.cs index 2e0ba50..27f3aa1 100644 --- a/src/Tests/Misc.cs +++ b/src/Tests/Misc.cs @@ -11,11 +11,12 @@ namespace Clarius.OpenLaw; public partial class Misc { [Theory] - [InlineData(@"SaijSamples\123456789-0abc-defg-g23-85000scanyel.json")] - [InlineData(@"SaijSamples\123456789-0abc-defg-g81-87000tcanyel.json")] - [InlineData(@"SaijSamples\123456789-0abc-defg-g56-95000scanyel.json")] + [InlineData("SaijSamples/123456789-0abc-defg-g23-85000scanyel.json")] + [InlineData("SaijSamples/123456789-0abc-defg-g81-87000tcanyel.json")] + [InlineData("SaijSamples/123456789-0abc-defg-g56-95000scanyel.json")] public void ConvertJsonToYaml(string jsonFile) { + jsonFile = Path.Combine(ThisAssembly.Project.MSBuildProjectDirectory, jsonFile); var json = File.ReadAllText(jsonFile).ReplaceLineEndings(); var dictionary = DictionaryConverter.Parse(json); @@ -25,14 +26,15 @@ public void ConvertJsonToYaml(string jsonFile) // Save the YAML to a file var yamlFile = Path.ChangeExtension(jsonFile, ".yaml"); - File.WriteAllText($@"..\..\..\{yamlFile}", yaml); + File.WriteAllText(yamlFile, yaml); } [Theory] - [InlineData(@"SaijSamples\123456789-0abc-defg-g23-85000scanyel.json")] - [InlineData(@"SaijSamples\123456789-0abc-defg-g56-95000scanyel.json")] + [InlineData("SaijSamples/123456789-0abc-defg-g23-85000scanyel.json")] + [InlineData("SaijSamples/123456789-0abc-defg-g56-95000scanyel.json")] public void ConvertJsonToMarkdown(string jsonFile) { + jsonFile = Path.Combine(ThisAssembly.Project.MSBuildProjectDirectory, jsonFile); var json = File.ReadAllText(jsonFile).ReplaceLineEndings(); var dictionary = DictionaryConverter.Parse(json); @@ -42,6 +44,6 @@ public void ConvertJsonToMarkdown(string jsonFile) // Save the Markdown to a file var markdownFile = Path.ChangeExtension(jsonFile, ".md"); - File.WriteAllText($@"..\..\..\{markdownFile}", markdown); + File.WriteAllText(markdownFile, markdown); } } diff --git a/src/Tests/Tests.csproj b/src/Tests/Tests.csproj index 81d6184..678e80d 100644 --- a/src/Tests/Tests.csproj +++ b/src/Tests/Tests.csproj @@ -10,6 +10,7 @@ + @@ -17,7 +18,7 @@ - +