From 6305ed6e4e7128dc8b0a428e577a0909fc53884b Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Wed, 13 Sep 2017 22:07:59 +0200 Subject: [PATCH] Put path to TestCases-dir into a constant. --- ICSharpCode.Decompiler.Tests/CorrectnessTestRunner.cs | 4 ++-- ICSharpCode.Decompiler.Tests/DecompilerTestBase.cs | 4 +++- ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs | 6 +++--- ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ICSharpCode.Decompiler.Tests/CorrectnessTestRunner.cs b/ICSharpCode.Decompiler.Tests/CorrectnessTestRunner.cs index 1f7457087..13c82a4b1 100644 --- a/ICSharpCode.Decompiler.Tests/CorrectnessTestRunner.cs +++ b/ICSharpCode.Decompiler.Tests/CorrectnessTestRunner.cs @@ -25,10 +25,10 @@ using NUnit.Framework; namespace ICSharpCode.Decompiler.Tests { - [TestFixture] + [TestFixture] public class CorrectnessTestRunner { - const string TestCasePath = @"../../../../ICSharpCode.Decompiler.Tests/TestCases/Correctness"; + const string TestCasePath = DecompilerTestBase.TestCasePath + "/Correctness"; [Test] public void AllFilesHaveTests() diff --git a/ICSharpCode.Decompiler.Tests/DecompilerTestBase.cs b/ICSharpCode.Decompiler.Tests/DecompilerTestBase.cs index 1559aa218..8959227be 100644 --- a/ICSharpCode.Decompiler.Tests/DecompilerTestBase.cs +++ b/ICSharpCode.Decompiler.Tests/DecompilerTestBase.cs @@ -32,9 +32,11 @@ namespace ICSharpCode.Decompiler.Tests { public abstract class DecompilerTestBase { + public const string TestCasePath = "../../../TestCases"; + protected static void ValidateFileRoundtrip(string samplesFileName) { - var fullPath = Path.Combine(@"../../../../ICSharpCode.Decompiler.Tests", samplesFileName); + var fullPath = Path.Combine(TestCasePath, "..", samplesFileName); AssertRoundtripCode(fullPath); } diff --git a/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs index dd35bd413..7d5efb32c 100644 --- a/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs +++ b/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs @@ -10,9 +10,9 @@ using NUnit.Framework; namespace ICSharpCode.Decompiler.Tests { - public class ILPrettyTestRunner - { - const string TestCasePath = @"../../../../ICSharpCode.Decompiler.Tests/TestCases/ILPretty"; + public class ILPrettyTestRunner + { + const string TestCasePath = DecompilerTestBase.TestCasePath + "/ILPretty"; [Test] public void AllFilesHaveTests() diff --git a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs index da01ee8ee..d0405e651 100644 --- a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs +++ b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs @@ -28,7 +28,7 @@ namespace ICSharpCode.Decompiler.Tests { public class PrettyTestRunner { - const string TestCasePath = @"../../../../ICSharpCode.Decompiler.Tests/TestCases/Pretty"; + const string TestCasePath = DecompilerTestBase.TestCasePath + "/Pretty"; [Test] public void AllFilesHaveTests()