diff --git a/SelfInitializingFakes.sln b/SelfInitializingFakes.sln index c1253ce..2e315bd 100644 --- a/SelfInitializingFakes.sln +++ b/SelfInitializingFakes.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26114.2 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33213.308 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3B5ADEC3-FC98-4938-B52C-52F421B3DBEB}" ProjectSection(SolutionItems) = preProject @@ -38,6 +38,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SelfInitializingFakes.Tests EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SelfInitializingFakes.Tests.FIE.5.5.0", "tests\SelfInitializingFakes.Tests.FIE.5.5.0\SelfInitializingFakes.Tests.FIE.5.5.0.csproj", "{27DE54D0-FB17-4A30-AB53-2FC98EEF2C4C}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SelfInitializingFakes.Tests.FIE.6.2.1", "tests\SelfInitializingFakes.Tests.FIE.6.2.1\SelfInitializingFakes.Tests.FIE.6.2.1.csproj", "{B669AFC9-B690-4EA7-B013-CB817711A7D3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -68,6 +70,10 @@ Global {27DE54D0-FB17-4A30-AB53-2FC98EEF2C4C}.Debug|Any CPU.Build.0 = Debug|Any CPU {27DE54D0-FB17-4A30-AB53-2FC98EEF2C4C}.Release|Any CPU.ActiveCfg = Release|Any CPU {27DE54D0-FB17-4A30-AB53-2FC98EEF2C4C}.Release|Any CPU.Build.0 = Release|Any CPU + {B669AFC9-B690-4EA7-B013-CB817711A7D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B669AFC9-B690-4EA7-B013-CB817711A7D3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B669AFC9-B690-4EA7-B013-CB817711A7D3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B669AFC9-B690-4EA7-B013-CB817711A7D3}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -79,6 +85,7 @@ Global {7F7EC34C-AA06-460B-B0B7-EF429DD99E21} = {71C0B811-4069-4D47-8D81-1F4EC66E21BF} {FB3705B3-8BD8-4293-9266-6DE11FDACB2B} = {71C0B811-4069-4D47-8D81-1F4EC66E21BF} {27DE54D0-FB17-4A30-AB53-2FC98EEF2C4C} = {71C0B811-4069-4D47-8D81-1F4EC66E21BF} + {B669AFC9-B690-4EA7-B013-CB817711A7D3} = {71C0B811-4069-4D47-8D81-1F4EC66E21BF} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A306C694-22A2-4AFB-974B-24B3629C8F28} diff --git a/appveyor.yml b/appveyor.yml index 1ebf732..31226f1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ version: '{build}' -image: Visual Studio 2019 +image: Visual Studio 2022 branches: only: diff --git a/how_to_build.md b/how_to_build.md index e32205c..ed1e1d7 100644 --- a/how_to_build.md +++ b/how_to_build.md @@ -9,18 +9,14 @@ At the time of writing the build is only confirmed to work on Windows using the ## Prerequisites -The build requires that a few pieces of software be installed on the host computer. We're somewhat aggressive about adoptiong new language features and the like, so rather than specifying exactly which versions are required, we'll tend toward +The build requires that a few pieces of software be installed on the host computer. We're somewhat aggressive about adoption new language features and the like, so rather than specifying exactly which versions are required, we'll tend toward "latest" or "at least" forms of guidance. If it seems you have an incompatible version of the software, prefer to upgrade rather than downgrade. -Ensure that the following are installed: +Ensure that recent versions of the following are installed: -1. a recent version of Visual Studio 2019 (currently this means 16.3 or later) or the Build Tools for Visual Studio 2019 - -1. a recent version of the .NET Core 1.0 Runtime - -1. a recent version of the .NET Core 3.1 SDK - -## Building +1. Visual Studio 2022 or the Build Tools for Visual Studio 2022 +1. .NET Core 1.0, 2.0, and 3.1 runtimes +1. .NET 7 SDK ## Building diff --git a/release_notes.md b/release_notes.md index acee1a2..a3287a5 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,3 +1,8 @@ +### New + +- Support FakeItEasy 7.* ([#92](https://github.com/blairconrad/SelfInitializingFakes/pull/92)) + + ## 0.6.0 ### New diff --git a/src/SelfInitializingFakes/SelfInitializingFakes.csproj b/src/SelfInitializingFakes/SelfInitializingFakes.csproj index 998ab35..e32f61b 100644 --- a/src/SelfInitializingFakes/SelfInitializingFakes.csproj +++ b/src/SelfInitializingFakes/SelfInitializingFakes.csproj @@ -28,12 +28,16 @@ - - + + - + + + + + diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index ce5c82f..5436ca3 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -3,7 +3,7 @@ - net452;netcoreapp1.0;netcoreapp2.0 + net452;netcoreapp2.0 true $(MSBuildThisFileDirectory)\SelfInitializingFakes.Tests.ruleset @@ -13,7 +13,7 @@ - + diff --git a/tests/SelfInitializingFakes.Tests.Api/ApiApproval.cs b/tests/SelfInitializingFakes.Tests.Api/ApiApproval.cs index 446b078..77e1f23 100644 --- a/tests/SelfInitializingFakes.Tests.Api/ApiApproval.cs +++ b/tests/SelfInitializingFakes.Tests.Api/ApiApproval.cs @@ -4,24 +4,26 @@ namespace FakeItEasy.Tests.Approval using System.IO; using System.Reflection; using System.Runtime.CompilerServices; - using ApprovalTests; - using ApprovalTests.Core; - using ApprovalTests.Reporters; - using ApprovalTests.Writers; + using System.Threading.Tasks; using PublicApiGenerator; + using VerifyTests; + using VerifyTests.DiffPlex; + using VerifyXunit; using Xunit; + [UsesVerify] public class ApiApproval { private const string ProjectName = "SelfInitializingFakes"; + static ApiApproval() => VerifyDiffPlex.Initialize(OutputType.Compact); + [InlineData("net40")] [InlineData("netstandard1.6")] [InlineData("netstandard2.0")] - [UseReporter(typeof(DiffReporter))] [MethodImpl(MethodImplOptions.NoInlining)] [Theory] - public void ApproveApi(string frameworkVersion) + public async Task ApproveApi(string frameworkVersion) { string codeBase = Assembly.GetExecutingAssembly().CodeBase!; UriBuilder uri = new UriBuilder(new Uri(codeBase)); @@ -36,25 +38,19 @@ public void ApproveApi(string frameworkVersion) var assembly = Assembly.LoadFile(Path.GetFullPath(assemblyFile)); var publicApi = ApiGenerator.GeneratePublicApi(assembly, options: null); - Approvals.Verify( - WriterFactory.CreateTextWriter(publicApi), - new ApprovalNamer(ProjectName, frameworkVersion), - Approvals.GetReporter()); + var settings = new VerifySettings(); + settings.UseDirectory("ApprovedApi/" + ProjectName); + settings.UseFileName(frameworkVersion); + + // If this starts failing for non-obvious reasons, or especially if + // there's differing behavior on the build server and a contributor's + // own machine, ensure that the same versions of the SDK are used to + // build, and clear all generated files (e.g. the obj directories) + // from the entire solution and try again. + // See https://github.com/dotnet/sdk/issues/10774#issuecomment-973973378 + await Verifier.Verify(publicApi, settings); } private static string GetSourceDirectory([CallerFilePath] string path = "") => Path.GetDirectoryName(path)!; - - private class ApprovalNamer : IApprovalNamer - { - public ApprovalNamer(string projectName, string frameworkVersion) - { - this.Name = frameworkVersion; - this.SourcePath = Path.Combine(GetSourceDirectory(), "ApprovedApi", projectName); - } - - public string SourcePath { get; } - - public string Name { get; } - } } } diff --git a/tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/net40.approved.txt b/tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/net40.verified.txt similarity index 100% rename from tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/net40.approved.txt rename to tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/net40.verified.txt diff --git a/tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/netstandard1.6.approved.txt b/tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/netstandard1.6.verified.txt similarity index 96% rename from tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/netstandard1.6.approved.txt rename to tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/netstandard1.6.verified.txt index 20e4bcd..477a65a 100644 --- a/tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/netstandard1.6.approved.txt +++ b/tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/netstandard1.6.verified.txt @@ -1,6 +1,6 @@ [assembly: System.Runtime.InteropServices.ComVisible(false)] [assembly: System.Runtime.InteropServices.Guid("08462e29-25c0-4a1f-9275-23b7898e95f0")] -[assembly: System.Runtime.Versioning.TargetFramework(".NETStandard,Version=v1.6", FrameworkDisplayName="")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETStandard,Version=v1.6", FrameworkDisplayName=".NET Standard 1.6")] namespace SelfInitializingFakes { public abstract class FileBasedRecordedCallRepository : SelfInitializingFakes.IRecordedCallRepository diff --git a/tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/netstandard2.0.approved.txt b/tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/netstandard2.0.verified.txt similarity index 96% rename from tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/netstandard2.0.approved.txt rename to tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/netstandard2.0.verified.txt index aa1323b..f6234dd 100644 --- a/tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/netstandard2.0.approved.txt +++ b/tests/SelfInitializingFakes.Tests.Api/ApprovedApi/SelfInitializingFakes/netstandard2.0.verified.txt @@ -1,6 +1,6 @@ [assembly: System.Runtime.InteropServices.ComVisible(false)] [assembly: System.Runtime.InteropServices.Guid("08462e29-25c0-4a1f-9275-23b7898e95f0")] -[assembly: System.Runtime.Versioning.TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName="")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName=".NET Standard 2.0")] namespace SelfInitializingFakes { public abstract class FileBasedRecordedCallRepository : SelfInitializingFakes.IRecordedCallRepository diff --git a/tests/SelfInitializingFakes.Tests.Api/SelfInitializingFakes.Tests.Api.csproj b/tests/SelfInitializingFakes.Tests.Api/SelfInitializingFakes.Tests.Api.csproj index 901bccf..00dc6da 100644 --- a/tests/SelfInitializingFakes.Tests.Api/SelfInitializingFakes.Tests.Api.csproj +++ b/tests/SelfInitializingFakes.Tests.Api/SelfInitializingFakes.Tests.Api.csproj @@ -6,9 +6,9 @@ - - + + \ No newline at end of file diff --git a/tests/SelfInitializingFakes.Tests.FIE.4.9.2/SelfInitializingFakes.Tests.FIE.4.9.2.csproj b/tests/SelfInitializingFakes.Tests.FIE.4.9.2/SelfInitializingFakes.Tests.FIE.4.9.2.csproj index 2b2b466..7596850 100644 --- a/tests/SelfInitializingFakes.Tests.FIE.4.9.2/SelfInitializingFakes.Tests.FIE.4.9.2.csproj +++ b/tests/SelfInitializingFakes.Tests.FIE.4.9.2/SelfInitializingFakes.Tests.FIE.4.9.2.csproj @@ -3,6 +3,7 @@ SelfInitializingFakes.Tests.FIE.4.9.2 SelfInitializingFakes.Tests.FIE.4.9.2 + net452;netcoreapp1.0;netcoreapp2.0 diff --git a/tests/SelfInitializingFakes.Tests.FIE.5.5.0/SelfInitializingFakes.Tests.FIE.5.5.0.csproj b/tests/SelfInitializingFakes.Tests.FIE.5.5.0/SelfInitializingFakes.Tests.FIE.5.5.0.csproj index fbe76c2..a8f4c31 100644 --- a/tests/SelfInitializingFakes.Tests.FIE.5.5.0/SelfInitializingFakes.Tests.FIE.5.5.0.csproj +++ b/tests/SelfInitializingFakes.Tests.FIE.5.5.0/SelfInitializingFakes.Tests.FIE.5.5.0.csproj @@ -3,6 +3,7 @@ SelfInitializingFakes.Tests.FIE.5.5.0 SelfInitializingFakes.Tests.FIE.5.5.0 + net452;netcoreapp1.0;netcoreapp2.0 diff --git a/tests/SelfInitializingFakes.Tests.FIE.6.2.1/SelfInitializingFakes.Tests.FIE.6.2.1.csproj b/tests/SelfInitializingFakes.Tests.FIE.6.2.1/SelfInitializingFakes.Tests.FIE.6.2.1.csproj new file mode 100644 index 0000000..4269748 --- /dev/null +++ b/tests/SelfInitializingFakes.Tests.FIE.6.2.1/SelfInitializingFakes.Tests.FIE.6.2.1.csproj @@ -0,0 +1,13 @@ + + + + net452;netcoreapp1.0;netcoreapp2.0 + SelfInitializingFakes.Tests.FIE.6.2.1 + SelfInitializingFakes.Tests.FIE.6.2.1 + + + + + + +