diff --git a/src/dotVariant.Generator.Test/SourceGenerator.Test.cs b/src/dotVariant.Generator.Test/SourceGenerator.Test.cs index 4fe3057..30f2fda 100644 --- a/src/dotVariant.Generator.Test/SourceGenerator.Test.cs +++ b/src/dotVariant.Generator.Test/SourceGenerator.Test.cs @@ -33,14 +33,10 @@ public static void Translation(string typeName, string fileName, string input, s $"{typeName}.cs"); var output = outputs[file]; output = _copyrightHeader + output; + if (output != expected) { - var commit = true; - //var commit = false; -#if CI - Assert.That(commit, Is.False); -#endif - if (commit) + if (_commitTranslations) { WriteSample(fileName, output); } @@ -48,6 +44,16 @@ public static void Translation(string typeName, string fileName, string input, s } } + private static readonly bool _commitTranslations = false; + + [Test] + public static void PreventCommitInMain() + { +#if CI + Assert.That(_commitTranslations, Is.False); +#endif + } + private static readonly string _samplesDir = Assembly .GetExecutingAssembly() diff --git a/src/dotVariant.sln b/src/dotVariant.sln index a97a0d2..edddd8f 100644 --- a/src/dotVariant.sln +++ b/src/dotVariant.sln @@ -1,7 +1,6 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31025.218 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotVariant", "dotVariant\dotVariant.csproj", "{B14D1B4F-EA99-4937-90C6-235AD8FB7251}" EndProject @@ -22,6 +21,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotVariant.Test-net45", "do EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "dotVariant.Test", "dotVariant.Test\dotVariant.Test.shproj", "{193D7A79-92BF-46BE-BB02-60360DA0883D}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{A5DAA24D-3270-4696-9620-104C5987E146}" + ProjectSection(SolutionItems) = preProject + ..\.github\workflows\publish.yaml = ..\.github\workflows\publish.yaml + ..\.github\workflows\test-package.yaml = ..\.github\workflows\test-package.yaml + ..\.github\workflows\test.yaml = ..\.github\workflows\test.yaml + EndProjectSection +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution dotVariant.Test\dotVariant.Test.projitems*{1305501c-65ab-4338-848f-3d2b919b7255}*SharedItemsImports = 5