Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions SelfInitializingFakes.sln
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: '{build}'

image: Visual Studio 2019
image: Visual Studio 2022

branches:
only:
Expand Down
14 changes: 5 additions & 9 deletions how_to_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### New

- Support FakeItEasy 7.* ([#92](https://github.com/blairconrad/SelfInitializingFakes/pull/92))


## 0.6.0

### New
Expand Down
10 changes: 7 additions & 3 deletions src/SelfInitializingFakes/SelfInitializingFakes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@
</Content>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
<PackageReference Include="FakeItEasy" Version="[3.0.0,7.0.0)" />
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0' AND '$(TargetFramework)' != 'netstandard1.6'">
<PackageReference Include="FakeItEasy" Version="[3.0.0,8.0.0)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="FakeItEasy" Version="[4.9.2,7.0.0)" />
<PackageReference Include="FakeItEasy" Version="[4.9.2,8.0.0)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.6'">
<PackageReference Include="FakeItEasy" Version="[3.0.0,7.0.0)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.6'">
Expand Down
4 changes: 2 additions & 2 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="../Directory.Build.props" />

<PropertyGroup>
<TargetFrameworks>net452;netcoreapp1.0;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>net452;netcoreapp2.0</TargetFrameworks>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)\SelfInitializingFakes.Tests.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
Expand All @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="FluentAssertions" Version="5.10.0" />
<PackageReference Include="Fluentassertions.Analyzers" Version="0.11.4" PrivateAssets="all" />
Expand Down
42 changes: 19 additions & 23 deletions tests/SelfInitializingFakes.Tests.Api/ApiApproval.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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; }
}
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ApprovalTests" Version="4.2.2" />
<PackageReference Include="ApprovalUtilities" Version="4.2.2" />
<PackageReference Include="PublicApiGenerator" Version="10.0.1" />
<PackageReference Include="Verify.DiffPlex" Version="2.0.0" />
<PackageReference Include="Verify.Xunit" Version="19.7.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<AssemblyName>SelfInitializingFakes.Tests.FIE.4.9.2</AssemblyName>
<PackageId>SelfInitializingFakes.Tests.FIE.4.9.2</PackageId>
<TargetFrameworks>net452;netcoreapp1.0;netcoreapp2.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<AssemblyName>SelfInitializingFakes.Tests.FIE.5.5.0</AssemblyName>
<PackageId>SelfInitializingFakes.Tests.FIE.5.5.0</PackageId>
<TargetFrameworks>net452;netcoreapp1.0;netcoreapp2.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net452;netcoreapp1.0;netcoreapp2.0</TargetFrameworks>
<AssemblyName>SelfInitializingFakes.Tests.FIE.6.2.1</AssemblyName>
<PackageId>SelfInitializingFakes.Tests.FIE.6.2.1</PackageId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FakeItEasy" Version="6.2.1" />
</ItemGroup>

</Project>