Skip to content

Commit 9b72fbd

Browse files
committed
Replaced ApprovalTests with Shouldly ShouldMatchApproved
1 parent 3149d96 commit 9b72fbd

13 files changed

+25
-78
lines changed

src/GitVersionCore.Tests/ApprovalTestsConfig.cs

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/GitVersionCore.Tests/ConfigProviderTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Linq;
44
using System.Reflection;
55
using System.Runtime.CompilerServices;
6-
using ApprovalTests;
76
using GitVersion;
87
using GitVersion.Helpers;
98
using NUnit.Framework;
@@ -123,7 +122,7 @@ public void CanWriteOutEffectiveConfiguration()
123122
{
124123
var config = ConfigurationProvider.GetEffectiveConfigAsString(repoPath, fileSystem);
125124

126-
Approvals.Verify(config);
125+
config.ShouldMatchApproved();
127126
}
128127

129128
[Test]

src/GitVersionCore.Tests/GitVersionCore.Tests.csproj

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,6 @@
3737
<DebugSymbols>true</DebugSymbols>
3838
</PropertyGroup>
3939
<ItemGroup>
40-
<Reference Include="ApprovalTests, Version=3.0.0.0, Culture=neutral, PublicKeyToken=11bd7d124fc62e0f, processorArchitecture=MSIL">
41-
<SpecificVersion>False</SpecificVersion>
42-
<HintPath>..\packages\ApprovalTests.3.0.8\lib\net40\ApprovalTests.dll</HintPath>
43-
</Reference>
44-
<Reference Include="ApprovalUtilities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=11bd7d124fc62e0f, processorArchitecture=MSIL">
45-
<SpecificVersion>False</SpecificVersion>
46-
<HintPath>..\packages\ApprovalUtilities.3.0.8\lib\net45\ApprovalUtilities.dll</HintPath>
47-
</Reference>
48-
<Reference Include="ApprovalUtilities.Net45">
49-
<HintPath>..\packages\ApprovalUtilities.3.0.8\lib\net45\ApprovalUtilities.Net45.dll</HintPath>
50-
</Reference>
5140
<Reference Include="FluentDateTime, Version=1.12.0.0, Culture=neutral, PublicKeyToken=6ccbc613702e6c71, processorArchitecture=MSIL">
5241
<HintPath>..\packages\FluentDateTime.1.12.0\Lib\NET35\FluentDateTime.dll</HintPath>
5342
<Private>True</Private>
@@ -96,8 +85,8 @@
9685
<HintPath>..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll</HintPath>
9786
<Private>True</Private>
9887
</Reference>
99-
<Reference Include="Shouldly, Version=2.5.0.0, Culture=neutral, PublicKeyToken=6042cbcb05cbc941, processorArchitecture=MSIL">
100-
<HintPath>..\packages\Shouldly.2.5.0\lib\net40\Shouldly.dll</HintPath>
88+
<Reference Include="Shouldly, Version=2.7.0.0, Culture=neutral, PublicKeyToken=6042cbcb05cbc941, processorArchitecture=MSIL">
89+
<HintPath>..\packages\Shouldly.2.7.0-beta0002\lib\net40\Shouldly.dll</HintPath>
10190
<Private>True</Private>
10291
</Reference>
10392
<Reference Include="System" />
@@ -170,7 +159,6 @@
170159
<Compile Include="Helpers\GitTestExtensions.cs" />
171160
<Compile Include="Helpers\PathHelper.cs" />
172161
<Compile Include="IntegrationTests\MasterScenarios.cs" />
173-
<Compile Include="ApprovalTestsConfig.cs" />
174162
<Compile Include="Fixtures\RepositoryFixtureBase.cs" />
175163
<Compile Include="SemanticVersionTests.cs" />
176164
<Compile Include="TestableVersionVariables.cs" />

src/GitVersionCore.Tests/Init/InitScenarios.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
namespace GitVersionCore.Tests.Init
22
{
3-
using ApprovalTests;
43
using GitVersion;
54
using GitVersion.Configuration.Init;
65
using GitVersion.Configuration.Init.Wizard;
76
using NUnit.Framework;
7+
using Shouldly;
88
using TestStack.ConventionTests;
99
using TestStack.ConventionTests.ConventionData;
1010

@@ -18,7 +18,7 @@ public void CanSetNextVersion()
1818
var testConsole = new TestConsole("3", "2.0.0", "0");
1919
ConfigurationProvider.Init("c:\\proj", testFileSystem, testConsole);
2020

21-
Approvals.Verify(testFileSystem.ReadAllText("c:\\proj\\GitVersionConfig.yaml"));
21+
testFileSystem.ReadAllText("c:\\proj\\GitVersionConfig.yaml").ShouldMatchApproved();
2222
}
2323

2424
[Test]

src/GitVersionCore.Tests/JsonVersionBuilderTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System;
2-
using ApprovalTests;
32
using GitVersion;
43
using GitVersionCore.Tests;
54
using NUnit.Framework;
5+
using Shouldly;
66

77
[TestFixture]
88
public class JsonVersionBuilderTests
@@ -23,6 +23,6 @@ public void Json()
2323

2424
var variables = VariableProvider.GetVariablesFor(semanticVersion, config, false);
2525
var json = JsonOutputFormatter.ToJson(variables);
26-
Approvals.Verify(json);
26+
json.ShouldMatchApproved();
2727
}
2828
}

src/GitVersionCore.Tests/VariableProviderTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System;
2-
using ApprovalTests;
32
using GitVersion;
43
using GitVersionCore.Tests;
54
using NUnit.Framework;
5+
using Shouldly;
66

77
[TestFixture]
88
public class VariableProviderTests
@@ -27,7 +27,7 @@ public void ProvidesVariablesInContinuousDeliveryModeForPreRelease()
2727

2828
var vars = VariableProvider.GetVariablesFor(semVer, config, false);
2929

30-
Approvals.Verify(JsonOutputFormatter.ToJson(vars));
30+
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved();
3131
}
3232

3333
[Test]
@@ -50,7 +50,7 @@ public void ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding()
5050

5151
var vars = VariableProvider.GetVariablesFor(semVer, config, false);
5252

53-
Approvals.Verify(JsonOutputFormatter.ToJson(vars));
53+
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved();
5454
}
5555

5656
[Test]
@@ -72,7 +72,7 @@ public void ProvidesVariablesInContinuousDeploymentModeForPreRelease()
7272

7373
var vars = VariableProvider.GetVariablesFor(semVer, config, false);
7474

75-
Approvals.Verify(JsonOutputFormatter.ToJson(vars));
75+
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved();
7676
}
7777

7878
[Test]
@@ -93,7 +93,7 @@ public void ProvidesVariablesInContinuousDeliveryModeForStable()
9393

9494
var vars = VariableProvider.GetVariablesFor(semVer, config, false);
9595

96-
Approvals.Verify(JsonOutputFormatter.ToJson(vars));
96+
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved();
9797
}
9898

9999
[Test]
@@ -114,7 +114,7 @@ public void ProvidesVariablesInContinuousDeploymentModeForStable()
114114

115115
var vars = VariableProvider.GetVariablesFor(semVer, config, false);
116116

117-
Approvals.Verify(JsonOutputFormatter.ToJson(vars));
117+
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved();
118118
}
119119

120120
[Test]
@@ -138,6 +138,6 @@ public void ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommi
138138

139139
var vars = VariableProvider.GetVariablesFor(semVer, config, true);
140140

141-
Approvals.Verify(JsonOutputFormatter.ToJson(vars));
141+
JsonOutputFormatter.ToJson(vars).ShouldMatchApproved();
142142
}
143143
}
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="ApprovalTests" version="3.0.8" targetFramework="net45" />
4-
<package id="ApprovalUtilities" version="3.0.8" targetFramework="net45" />
53
<package id="FluentDateTime" version="1.12.0" targetFramework="net45" />
64
<package id="Fody" version="1.29.3" targetFramework="net45" developmentDependency="true" />
75
<package id="LibGit2Sharp" version="0.21.0.176" targetFramework="net45" />
@@ -10,7 +8,7 @@
108
<package id="NSubstitute" version="1.9.2.0" targetFramework="net45" />
119
<package id="NUnit" version="2.6.4" targetFramework="net45" />
1210
<package id="NUnitTestAdapter" version="2.0.0" targetFramework="net45" />
13-
<package id="Shouldly" version="2.5.0" targetFramework="net45" />
1411
<package id="TestStack.ConventionTests" version="2.2.1" targetFramework="net45" />
12+
<package id="Shouldly" version="2.7.0-beta0002" targetFramework="net45" />
1513
<package id="YamlDotNet" version="3.6.1" targetFramework="net45" />
1614
</packages>

src/GitVersionExe.Tests/GitVersionExe.Tests.csproj

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,6 @@
3434
<DebugSymbols>true</DebugSymbols>
3535
</PropertyGroup>
3636
<ItemGroup>
37-
<Reference Include="ApprovalTests, Version=3.0.0.0, Culture=neutral, PublicKeyToken=11bd7d124fc62e0f, processorArchitecture=MSIL">
38-
<SpecificVersion>False</SpecificVersion>
39-
<HintPath>..\packages\ApprovalTests.3.0.8\lib\net40\ApprovalTests.dll</HintPath>
40-
</Reference>
41-
<Reference Include="ApprovalUtilities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=11bd7d124fc62e0f, processorArchitecture=MSIL">
42-
<SpecificVersion>False</SpecificVersion>
43-
<HintPath>..\packages\ApprovalUtilities.3.0.8\lib\net45\ApprovalUtilities.dll</HintPath>
44-
</Reference>
45-
<Reference Include="ApprovalUtilities.Net45">
46-
<HintPath>..\packages\ApprovalUtilities.3.0.8\lib\net45\ApprovalUtilities.Net45.dll</HintPath>
47-
</Reference>
4837
<Reference Include="LibGit2Sharp, Version=0.21.0.176, Culture=neutral, processorArchitecture=MSIL">
4938
<HintPath>..\packages\LibGit2Sharp.0.21.0.176\lib\net40\LibGit2Sharp.dll</HintPath>
5039
<Private>True</Private>
@@ -73,8 +62,8 @@
7362
<HintPath>..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll</HintPath>
7463
<Private>True</Private>
7564
</Reference>
76-
<Reference Include="Shouldly, Version=2.5.0.0, Culture=neutral, PublicKeyToken=6042cbcb05cbc941, processorArchitecture=MSIL">
77-
<HintPath>..\packages\Shouldly.2.5.0\lib\net40\Shouldly.dll</HintPath>
65+
<Reference Include="Shouldly, Version=2.7.0.0, Culture=neutral, PublicKeyToken=6042cbcb05cbc941, processorArchitecture=MSIL">
66+
<HintPath>..\packages\Shouldly.2.7.0-beta0002\lib\net40\Shouldly.dll</HintPath>
7867
<Private>True</Private>
7968
</Reference>
8069
<Reference Include="System" />
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="ApprovalTests" version="3.0.8" targetFramework="net45" />
4-
<package id="ApprovalUtilities" version="3.0.8" targetFramework="net45" />
53
<package id="LibGit2Sharp" version="0.21.0.176" targetFramework="net45" />
64
<package id="NSubstitute" version="1.8.2.0" targetFramework="net45" />
75
<package id="NUnit" version="2.6.4" targetFramework="net45" />
86
<package id="NUnitTestAdapter" version="2.0.0" targetFramework="net45" />
9-
<package id="Shouldly" version="2.5.0" targetFramework="net45" />
7+
<package id="Shouldly" version="2.7.0-beta0002" targetFramework="net45" />
108
</packages>

src/GitVersionTask.Tests/ApprovalTestsConfig.cs

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)