Skip to content

Commit 56eaf1a

Browse files
committed
Moved all approval tests to an Approved subfolder
1 parent 916c28d commit 56eaf1a

17 files changed

+49
-28
lines changed

src/GitVersionCore.Tests/GitVersionCore.Tests.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,13 @@
176176
</ItemGroup>
177177
<ItemGroup>
178178
<Content Include="FodyWeavers.xml" />
179-
<Content Include="JsonVersionBuilderTests.Json.approved.txt" />
180-
<Content Include="VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreRelease.approved.txt" />
181-
<Content Include="VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding.approved.txt" />
182-
<Content Include="VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForStable.approved.txt" />
183-
<Content Include="VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForPreRelease.approved.txt" />
184-
<Content Include="VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStable.approved.txt" />
185-
<Content Include="VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged.approved.txt" />
179+
<Content Include="Approved\JsonVersionBuilderTests.Json.approved.txt" />
180+
<Content Include="Approved\VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreRelease.approved.txt" />
181+
<Content Include="Approved\VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding.approved.txt" />
182+
<Content Include="Approved\VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForStable.approved.txt" />
183+
<Content Include="Approved\VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForPreRelease.approved.txt" />
184+
<Content Include="Approved\VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStable.approved.txt" />
185+
<Content Include="Approved\VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged.approved.txt" />
186186
</ItemGroup>
187187
<ItemGroup>
188188
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />

src/GitVersionCore.Tests/JsonVersionBuilderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ public void Json()
2525

2626
var variables = VariableProvider.GetVariablesFor(semanticVersion, config, false);
2727
var json = JsonOutputFormatter.ToJson(variables);
28-
json.ShouldMatchApproved();
28+
json.ShouldMatchApproved(c => c.SubFolder("Approved"));
2929
}
3030
}

src/GitVersionCore.Tests/VariableProviderTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void ProvidesVariablesInContinuousDeliveryModeForPreRelease()
2929

3030
var vars = VariableProvider.GetVariablesFor(semVer, config, false);
3131

32-
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved();
32+
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved(c => c.SubFolder("Approved"));
3333
}
3434

3535
[Test]
@@ -54,7 +54,7 @@ public void ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding()
5454

5555
var vars = VariableProvider.GetVariablesFor(semVer, config, false);
5656

57-
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved();
57+
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved(c => c.SubFolder("Approved"));
5858
}
5959

6060
[Test]
@@ -78,7 +78,7 @@ public void ProvidesVariablesInContinuousDeploymentModeForPreRelease()
7878

7979
var vars = VariableProvider.GetVariablesFor(semVer, config, false);
8080

81-
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved();
81+
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved(c => c.SubFolder("Approved"));
8282
}
8383

8484
[Test]
@@ -101,7 +101,7 @@ public void ProvidesVariablesInContinuousDeliveryModeForStable()
101101

102102
var vars = VariableProvider.GetVariablesFor(semVer, config, false);
103103

104-
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved();
104+
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved(c => c.SubFolder("Approved"));
105105
}
106106

107107
[Test]
@@ -124,7 +124,7 @@ public void ProvidesVariablesInContinuousDeploymentModeForStable()
124124

125125
var vars = VariableProvider.GetVariablesFor(semVer, config, false);
126126

127-
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved();
127+
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved(c => c.SubFolder("Approved"));
128128
}
129129

130130
[Test]
@@ -150,6 +150,6 @@ public void ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommi
150150

151151
var vars = VariableProvider.GetVariablesFor(semVer, config, true);
152152

153-
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved();
153+
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved(c => c.SubFolder("Approved"));
154154
}
155155
}

src/GitVersionExe.Tests/AssemblyInfoFileUpdateTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void ShouldCreateCSharpAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo
3434
var variables = VariableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v"), new TestEffectiveConfiguration(), false);
3535
using (new AssemblyInfoFileUpdate(new Arguments { EnsureAssemblyInfo = true, UpdateAssemblyInfo = true, UpdateAssemblyInfoFileName = assemblyInfoFile}, workingDir, variables, fileSystem))
3636
{
37-
fileSystem.ReadAllText(fullPath).ShouldMatchApproved();
37+
fileSystem.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(Path.Combine("Approved", "CSharp")));
3838
}
3939
}
4040

@@ -51,7 +51,7 @@ public void ShouldCreateCSharpAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemb
5151
var variables = VariableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v"), new TestEffectiveConfiguration(), false);
5252
using (new AssemblyInfoFileUpdate(new Arguments { EnsureAssemblyInfo = true, UpdateAssemblyInfo = true, UpdateAssemblyInfoFileName = assemblyInfoFile }, workingDir, variables, fileSystem))
5353
{
54-
fileSystem.ReadAllText(fullPath).ShouldMatchApproved();
54+
fileSystem.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(Path.Combine("Approved", "CSharp")));
5555
}
5656
}
5757

@@ -71,7 +71,7 @@ public void ShouldCreateCSharpAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssem
7171
{
7272
var fullPath = Path.Combine(workingDir, item);
7373
var fileDescriminator = item.Replace(Path.DirectorySeparatorChar.ToString(), string.Empty).Replace(".", string.Empty);
74-
fileSystem.ReadAllText(fullPath).ShouldMatchApproved(c => c.WithDescriminator(fileDescriminator));
74+
fileSystem.ReadAllText(fullPath).ShouldMatchApproved(c => c.WithDescriminator(fileDescriminator).SubFolder(Path.Combine("Approved", "CSharp")));
7575
}
7676
}
7777
}

src/GitVersionExe.Tests/GitVersionExe.Tests.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@
120120
<ItemGroup>
121121
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
122122
</ItemGroup>
123+
<ItemGroup>
124+
<Content Include="Approved\FSharp\AssemblyInfoFileUpdateTests.ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile.approved.txt" />
125+
<Content Include="Approved\CSharp\AssemblyInfoFileUpdateTests.ShouldCreateCSharpAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt" />
126+
<Content Include="Approved\CSharp\AssemblyInfoFileUpdateTests.ShouldCreateCSharpAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo.AssemblyInfocs.approved.txt" />
127+
<Content Include="Approved\CSharp\AssemblyInfoFileUpdateTests.ShouldCreateCSharpAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo.srcProjectPropertiesVersionAssemblyInfocs.approved.txt" />
128+
<Content Include="Approved\CSharp\AssemblyInfoFileUpdateTests.ShouldCreateCSharpAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo.approved.txt" />
129+
</ItemGroup>
130+
<ItemGroup>
131+
<Folder Include="Approved\VisualBasic\" />
132+
</ItemGroup>
123133
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
124134
<PropertyGroup>
125135
<PostBuildEvent>

src/GitVersionTask.Tests/GitVersionTask.Tests.csproj

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,28 @@
150150
</None>
151151
</ItemGroup>
152152
<ItemGroup>
153-
<Content Include="AssemblyInfoBuilderTests.VerifyAssemblyVersion_Major.approved.txt" />
154-
<Content Include="AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinor.approved.txt" />
155-
<Content Include="AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinorPatch.approved.txt" />
156-
<Content Include="AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinorPatchTag.approved.txt" />
157-
<Content Include="AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinorPatchTag_NugetAssemblyInfo.approved.txt" />
158-
<Content Include="AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinorPatch_NugetAssemblyInfo.approved.txt" />
159-
<Content Include="AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinor_NugetAssemblyInfo.approved.txt" />
160-
<Content Include="AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinor_NugetAssemblyInfoWithMultipleVariables.approved.txt" />
161-
<Content Include="AssemblyInfoBuilderTests.VerifyAssemblyVersion_Major_NugetAssemblyInfo.approved.txt" />
162-
<Content Include="AssemblyInfoBuilderTests.VerifyCreatedCode_NoNamespaceConflict.approved.txt" />
163-
<Content Include="AssemblyInfoBuilderTests.VerifyCreatedCode.approved.txt" />
153+
<Content Include="Approved\CSharp\AssemblyInfoBuilderTests.VerifyAssemblyVersion_Major.approved.txt" />
154+
<Content Include="Approved\CSharp\AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinor.approved.txt" />
155+
<Content Include="Approved\CSharp\AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinorPatch.approved.txt" />
156+
<Content Include="Approved\CSharp\AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinorPatchTag.approved.txt" />
157+
<Content Include="Approved\CSharp\AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinorPatchTag_NugetAssemblyInfo.approved.txt" />
158+
<Content Include="Approved\CSharp\AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinorPatch_NugetAssemblyInfo.approved.txt" />
159+
<Content Include="Approved\CSharp\AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinor_NugetAssemblyInfo.approved.txt" />
160+
<Content Include="Approved\CSharp\AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinor_NugetAssemblyInfoWithMultipleVariables.approved.txt" />
161+
<Content Include="Approved\CSharp\AssemblyInfoBuilderTests.VerifyAssemblyVersion_Major_NugetAssemblyInfo.approved.txt" />
162+
<Content Include="Approved\CSharp\AssemblyInfoBuilderTests.VerifyCreatedCode.approved.txt" />
163+
<Content Include="Approved\CSharp\AssemblyInfoBuilderTests.VerifyCreatedCode_NoNamespaceConflict.approved.txt" />
164+
<Content Include="Approved\VisualBasic\AssemblyInfoBuilderTests.VerifyAssemblyVersion_Major.approved.txt" />
165+
<Content Include="Approved\VisualBasic\AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinor.approved.txt" />
166+
<Content Include="Approved\VisualBasic\AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinorPatch.approved.txt" />
167+
<Content Include="Approved\VisualBasic\AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinorPatchTag.approved.txt" />
168+
<Content Include="Approved\VisualBasic\AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinorPatchTag_NugetAssemblyInfo.approved.txt" />
169+
<Content Include="Approved\VisualBasic\AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinorPatch_NugetAssemblyInfo.approved.txt" />
170+
<Content Include="Approved\VisualBasic\AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinor_NugetAssemblyInfo.approved.txt" />
171+
<Content Include="Approved\VisualBasic\AssemblyInfoBuilderTests.VerifyAssemblyVersion_MajorMinor_NugetAssemblyInfoWithMultipleVariables.approved.txt" />
172+
<Content Include="Approved\VisualBasic\AssemblyInfoBuilderTests.VerifyAssemblyVersion_Major_NugetAssemblyInfo.approved.txt" />
173+
<Content Include="Approved\VisualBasic\AssemblyInfoBuilderTests.VerifyCreatedCode.approved.txt" />
174+
<Content Include="Approved\VisualBasic\AssemblyInfoBuilderTests.VerifyCreatedCode_NoNamespaceConflict.approved.txt" />
164175
<Content Include="FodyWeavers.xml" />
165176
</ItemGroup>
166177
<ItemGroup>

0 commit comments

Comments
 (0)