Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .NET Standard 2.0 target #1436

Merged
merged 76 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
ba75168
Add .NET Standard 2.0 target
AArnott Dec 20, 2024
610f4c2
Merge branch 'main' into netfx
thomhurst Dec 20, 2024
fac63e7
.NET Framework Pipeline
thomhurst Dec 20, 2024
763e436
Merge branch 'main' into netfx
thomhurst Dec 20, 2024
7aad5f0
Fixes
thomhurst Dec 20, 2024
e917724
Tidy
thomhurst Dec 20, 2024
f1a7131
Tidy backport locks
thomhurst Dec 20, 2024
18759f3
Fix
thomhurst Dec 20, 2024
c1e2ebc
Fix
thomhurst Dec 20, 2024
e244c50
IsLibraryPackage
thomhurst Dec 20, 2024
c16ce15
Backport lock fix
thomhurst Dec 20, 2024
cfcbcc2
Fix
thomhurst Dec 20, 2024
eaf42b8
Compilation fixes
thomhurst Dec 20, 2024
d5d27f6
Fixes
thomhurst Dec 20, 2024
1bcb7d0
Source Gen tweaks
thomhurst Dec 20, 2024
f0b6134
Fixes
thomhurst Dec 20, 2024
5170cb2
Fixes
thomhurst Dec 20, 2024
7885160
Fixes
thomhurst Dec 20, 2024
e762215
Fixes
thomhurst Dec 20, 2024
329d438
Fix
thomhurst Dec 20, 2024
2aeaa6f
Fixes
thomhurst Dec 20, 2024
0f65a90
Fixes
thomhurst Dec 20, 2024
7545d12
ContainingNamespace
thomhurst Dec 20, 2024
486630a
Fixes
thomhurst Dec 21, 2024
78137ac
Fixes
thomhurst Dec 21, 2024
f718f47
More net472
thomhurst Dec 21, 2024
92935d4
IsLibraryTestProject
thomhurst Dec 21, 2024
1f2a409
Remove reference
thomhurst Dec 21, 2024
bb6011a
Fix
thomhurst Dec 21, 2024
94d7d78
Rework props
thomhurst Dec 21, 2024
8ecbf4e
MSBuildThisFileDirectory
thomhurst Dec 21, 2024
aba955e
Fixes
thomhurst Dec 21, 2024
cc93da4
Fix
thomhurst Dec 21, 2024
1aa3047
Fix
thomhurst Dec 21, 2024
51416e9
Fixes
thomhurst Dec 21, 2024
cf70b83
Tidy
thomhurst Dec 21, 2024
33be674
WIP
thomhurst Dec 21, 2024
7dcd0ec
Merge branch 'main' into netfx
thomhurst Dec 23, 2024
212a036
Compilation fixes
thomhurst Dec 23, 2024
ff85748
Compilation fixes
thomhurst Dec 23, 2024
d7a41c1
Trim on .NET 8 upwards
thomhurst Dec 23, 2024
37e7631
Fix
thomhurst Dec 23, 2024
d479fc0
Fixes
thomhurst Dec 23, 2024
dce56d5
Skip
thomhurst Dec 23, 2024
29b7605
Environment.GetEnvironmentVariable("NET_VERSION")
thomhurst Dec 23, 2024
bba0f76
Fixes
thomhurst Dec 23, 2024
0864ad7
Fix
thomhurst Dec 23, 2024
babe88f
Merge main
thomhurst Dec 24, 2024
e170a13
Fix
thomhurst Dec 24, 2024
94a40e2
Source generate attribute invocations
thomhurst Dec 24, 2024
491e763
MethodInfoRetriever
thomhurst Dec 24, 2024
6b4b88e
MethodInfoRetriever
thomhurst Dec 24, 2024
083728a
MethodInfoRetriever
thomhurst Dec 24, 2024
68c579c
Enum fix
thomhurst Dec 24, 2024
9168b31
Enum fix
thomhurst Dec 24, 2024
f302e25
Merge main
thomhurst Dec 24, 2024
fb04038
Remove dupe package versions
thomhurst Dec 24, 2024
212f973
Remove dupe package versions
thomhurst Dec 24, 2024
680d964
Remove calls to GetCustomAttributes
thomhurst Dec 24, 2024
e5f673a
Fix verify tests
thomhurst Dec 24, 2024
d2cbc9c
Fix
thomhurst Dec 24, 2024
7d7c23c
Fix
thomhurst Dec 24, 2024
d2b9bea
record
thomhurst Dec 24, 2024
59febcb
IComparable
thomhurst Dec 24, 2024
994aff3
IComparable
thomhurst Dec 24, 2024
653e587
Tweak
thomhurst Dec 24, 2024
7484f2f
Tweak
thomhurst Dec 24, 2024
6d61baf
IComparable
thomhurst Dec 24, 2024
926bcd0
Nullable
thomhurst Dec 24, 2024
86ec322
TargetFrameworks
thomhurst Dec 24, 2024
6d29aa5
return early
thomhurst Dec 24, 2024
44fb07f
IComparable
thomhurst Dec 25, 2024
e8858a4
New PriorityQueue implementation
thomhurst Dec 25, 2024
29b4fd2
Remove C5
thomhurst Dec 25, 2024
ffcbccf
Update TUnit.NugetTester.Library.csproj
thomhurst Dec 25, 2024
9970991
Update TUnit.NugetTester.csproj
thomhurst Dec 25, 2024
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
7 changes: 6 additions & 1 deletion .github/actions/execute-pipeline/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
description: 'Environment'
required: false
default: 'Development'
netversion:
description: 'Net version'
required: false
default: 'net9.0'

runs:
using: "composite"
Expand All @@ -33,4 +37,5 @@ runs:
GITHUB_TOKEN: ${{ github.token }}
DOTNET_ENVIRONMENT: ${{ inputs.environment }}
NuGet__ApiKey: ${{ inputs.nuget-apikey }}
NuGet__ShouldPublish: ${{ inputs.publish-packages }}
NuGet__ShouldPublish: ${{ inputs.publish-packages }}
NET_VERSION: ${{ inputs.netversion }}
34 changes: 34 additions & 0 deletions .github/workflows/dotnet-framework.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: .NET Framework

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
modularpipeline-netframework:
environment: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Pull Requests' }}
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Setup .NET Framework
uses: microsoft/setup-msbuild@v2

- name: Build
run: dotnet build -c Release -p:TreatWarningsAsErrors=true

- name: Run Pipeline
uses: ./.github/actions/execute-pipeline
with:
environment: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Development' }}
netversion: 'net472'
15 changes: 3 additions & 12 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!--suppress MsbuildTargetFrameworkTagInspection -->
<TargetFrameworks Condition="'$(SDK_VERSION)' == 'net8'">net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(SDK_VERSION)' == 'net9'">net8.0;net9.0</TargetFrameworks>

<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand All @@ -29,17 +29,8 @@
</PropertyGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>TUnit.Core</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>TUnit.Assertions</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>TUnit.Engine</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>TUnit</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>TUnit.UnitTests</_Parameter1>
Expand Down Expand Up @@ -84,5 +75,5 @@
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)assets/logo.png" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>

</Project>
69 changes: 40 additions & 29 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,34 +1,45 @@
<Project>
<Import
Condition="('$(IsLibraryPackage)' == 'true' or '$(IsLibraryTestProject)' == 'true') and '$(EnablePolyfill)' != 'false'"
Project="$(MSBuildThisFileDirectory)Polyfill.props" />

<PropertyGroup>
<TargetFrameworks Condition="'$(IsLibraryPackage)' == 'true'">netstandard2.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks Condition="'$(IsLibraryTestProject)' == 'true'">net472;net8.0;net9.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(IsTestingPlatformApplication)' == 'true'">
<OutputType>Exe</OutputType>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
<TestingPlatformCaptureOutput>false</TestingPlatformCaptureOutput>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<PropertyGroup>
<DefineConstants Condition="$(RoslynVersion) >= 4.7">$(DefineConstants);ROSLYN4_7_OR_GREATER</DefineConstants>
<EnableTrimAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</EnableTrimAnalyzer>
</PropertyGroup>
<PropertyGroup Condition="'$(IsTestingPlatformApplication)' == 'true'">
<OutputType>Exe</OutputType>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
<TestingPlatformCaptureOutput>false</TestingPlatformCaptureOutput>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<PropertyGroup>
<DefineConstants Condition="$(RoslynVersion) >= 4.7">$(DefineConstants);ROSLYN4_7_OR_GREATER</DefineConstants>
<EnableTrimAnalyzer Condition="'$(TargetFramework)' != 'netstandard2.0'">true</EnableTrimAnalyzer>
</PropertyGroup>

<ItemGroup Condition="'$(IsTestingPlatformApplication)' == 'true'">
<Using Include="TUnit.Core.HookType" Static="True" />
<Using Include="TUnit.Core" />
<ProjectReference Include="..\TUnit.Engine\TUnit.Engine.csproj" />
<ProjectReference Include="..\TUnit.Assertions\TUnit.Assertions.csproj" />
<PackageReference Include="Microsoft.Testing.Platform.MSBuild" />

<ProjectReference Include="$(MSBuildThisFileDirectory)TUnit.Core.SourceGenerator\TUnit.Core.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="$(MSBuildThisFileDirectory)TUnit.Analyzers\TUnit.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="$(MSBuildThisFileDirectory)TUnit.Assertions.Analyzers\TUnit.Assertions.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<TestingPlatformBuilderHook Include="6ADF853A-6945-4A06-9A4B-D99BC1DC1094">
<DisplayName>TUnit</DisplayName>
<TypeFullName>TUnit.Engine.Framework.TestingPlatformBuilderHook</TypeFullName>
</TestingPlatformBuilderHook>
</ItemGroup>
<ItemGroup Condition="'$(IsTestingPlatformApplication)' == 'true'">
<Using Include="TUnit.Core.HookType" Static="True" />
<Using Include="TUnit.Core" />

<ProjectReference Include="..\TUnit.Engine\TUnit.Engine.csproj" />
<ProjectReference Include="..\TUnit.Assertions\TUnit.Assertions.csproj" />
<PackageReference Include="Microsoft.Testing.Platform.MSBuild" />

<ProjectReference
Include="$(MSBuildThisFileDirectory)TUnit.Core.SourceGenerator\TUnit.Core.SourceGenerator.csproj"
OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="$(MSBuildThisFileDirectory)TUnit.Analyzers\TUnit.Analyzers.csproj"
OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference
Include="$(MSBuildThisFileDirectory)TUnit.Assertions.Analyzers\TUnit.Assertions.Analyzers.csproj"
OutputItemType="Analyzer" ReferenceOutputAssembly="false" />

<TestingPlatformBuilderHook Include="6ADF853A-6945-4A06-9A4B-D99BC1DC1094">
<DisplayName>TUnit</DisplayName>
<TypeFullName>TUnit.Engine.Framework.TestingPlatformBuilderHook</TypeFullName>
</TestingPlatformBuilderHook>
</ItemGroup>
</Project>
6 changes: 4 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="AutoFixture" Version="4.18.1" />
<PackageVersion Include="Backport.System.Threading.Lock" Version="3.1.1" />
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="CliWrap" Version="3.7.0" />
Expand All @@ -27,6 +26,7 @@
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing" Version="1.1.2" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.12.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.7.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Microsoft.Playwright" Version="1.49.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
Expand All @@ -44,14 +44,16 @@
<PackageVersion Include="NUnit.Analyzers" Version="4.5.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageVersion Include="Polly" Version="8.5.0" />
<PackageVersion Include="PolySharp" Version="1.15.0" />
<PackageVersion Include="Polyfill" Version="7.8.0" />
<PackageVersion Include="Sourcy.DotNet" Version="0.0.66" />
<PackageVersion Include="Sourcy.Git" Version="0.0.66" />
<PackageVersion Include="StreamJsonRpc" Version="2.20.20" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.0" />
<PackageVersion Include="Testcontainers.PostgreSql" Version="4.1.0" />
<PackageVersion Include="trxparser" Version="0.5.0" />
<PackageVersion Include="Verify.NUnit" Version="28.7.0" />
<PackageVersion Include="TUnit" Version="0.5.32" />
<PackageVersion Include="TUnit.Core" Version="0.5.32" />
<PackageVersion Include="TUnit.Assertions" Version="0.5.32" />
Expand Down
13 changes: 13 additions & 0 deletions Polyfill.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project>
<ItemGroup>
<PackageReference Include="Polyfill">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)'!='.NETCoreApp'">
<PackageReference Include="System.Text.Json" />
<PackageReference Include="System.Threading.Tasks.Extensions" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion TUnit.Analyzers.Roslyn44/TUnit.Analyzers.Roslyn44.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Common" VersionOverride="$(RoslynVersion).*"/>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" VersionOverride="$(RoslynVersion).*"/>
<PackageReference Include="PolySharp">
<PackageReference Include="Polyfill">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion TUnit.Analyzers.Roslyn47/TUnit.Analyzers.Roslyn47.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Common" VersionOverride="$(RoslynVersion).*"/>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" VersionOverride="$(RoslynVersion).*"/>
<PackageReference Include="PolySharp">
<PackageReference Include="Polyfill">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion TUnit.Analyzers/TUnit.Analyzers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.Common" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
<PackageReference Include="PolySharp">
<PackageReference Include="Polyfill">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
3 changes: 2 additions & 1 deletion TUnit.Assertions.Tests/TUnit.Assertions.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsLibraryTestProject>true</IsLibraryTestProject>
<LangVersion>preview</LangVersion>
<IsTestingPlatformApplication>true</IsTestingPlatformApplication>
<IsPackable>false</IsPackable>
Expand Down
8 changes: 4 additions & 4 deletions TUnit.Assertions.UnitTests/AsyncTaskTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ public async Task Func_Awaited_Task_Is_Callable()
[Test]
public async Task Func_Awaited_ValueTask_Is_Callable()
{
await TUnitAssert.That(async () => await ValueTask.FromResult("Hello")).IsNotNullOrEmpty().And.IsEqualTo("Hello");
await TUnitAssert.That(async () => await new ValueTask<string>(Task.FromResult("Hello"))).IsNotNullOrEmpty().And.IsEqualTo("Hello");
}

[Test]
public async Task ValueTask_Is_Callable()
{
await TUnitAssert.That(ValueTask.FromResult("Hello")).IsNotNullOrEmpty().And.IsEqualTo("Hello");
await TUnitAssert.That(new ValueTask<string>(Task.FromResult("Hello"))).IsNotNullOrEmpty().And.IsEqualTo("Hello");
}

[Test]
Expand All @@ -52,7 +52,7 @@ public async Task Func_Throws_Awaited_Task_Is_Callable()
[Test]
public async Task Func_Throws_Awaited_ValueTask_Is_Callable()
{
await TUnitAssert.ThrowsAsync(async () => await ValueTask.FromException(new DivideByZeroException()));
await TUnitAssert.ThrowsAsync(async () => await new ValueTask(Task.FromException(new DivideByZeroException())));
}

[Test]
Expand All @@ -64,6 +64,6 @@ public async Task Throws_Task_Is_Callable()
[Test]
public async Task Throws_ValueTask_Is_Callable()
{
await TUnitAssert.ThrowsAsync(ValueTask.FromException(new DivideByZeroException()));
await TUnitAssert.ThrowsAsync(new ValueTask(Task.FromException(new DivideByZeroException())));
}
}
6 changes: 4 additions & 2 deletions TUnit.Assertions.UnitTests/DateOnlyEqualToAssertionTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using TUnit.Assertions.Extensions;
#if NET
using TUnit.Assertions.Extensions;

namespace TUnit.Assertions.UnitTests;

Expand Down Expand Up @@ -41,4 +42,5 @@ public void EqualsTo__With_Tolerance_Failure()

NUnitAssert.ThrowsAsync<TUnitAssertionException>(async () => await TUnitAssert.That(value1).IsEqualTo(value2).WithinDays(1));
}
}
}
#endif
2 changes: 2 additions & 0 deletions TUnit.Assertions.UnitTests/DecimalEqualsToAssertionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public void Decimal_EqualsTo_Failure()
NUnitAssert.ThrowsAsync<TUnitAssertionException>(async () => await TUnitAssert.That(double1).IsEqualTo(double2));
}

#if NET
[Test]
public async Task Decimal_EqualsTo__With_Tolerance_Success()
{
Expand All @@ -39,4 +40,5 @@ public void Decimal_EqualsTo__With_Tolerance_Failure()

NUnitAssert.ThrowsAsync<TUnitAssertionException>(async () => await TUnitAssert.That(double1).IsEqualTo(double2).Within(0.0001));
}
#endif
}
4 changes: 3 additions & 1 deletion TUnit.Assertions.UnitTests/DoubleEqualsToAssertionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public void Double_EqualsTo_Failure()
NUnitAssert.ThrowsAsync<TUnitAssertionException>(async () => await TUnitAssert.That(double1).IsEqualTo(double2));
}

#if NET
[Test]
public async Task Double_EqualsTo__With_Tolerance_Success()
{
Expand All @@ -30,7 +31,7 @@ public async Task Double_EqualsTo__With_Tolerance_Success()

await TUnitAssert.That(double1).IsEqualTo(double2).Within(0.1);
}

[Test]
public void Double_EqualsTo__With_Tolerance_Failure()
{
Expand All @@ -39,4 +40,5 @@ public void Double_EqualsTo__With_Tolerance_Failure()

NUnitAssert.ThrowsAsync<TUnitAssertionException>(async () => await TUnitAssert.That(double1).IsEqualTo(double2).Within(0.1));
}
#endif
}
2 changes: 2 additions & 0 deletions TUnit.Assertions.UnitTests/IntegerEqualsToAssertionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public void Integer_EqualsTo_Failure()
NUnitAssert.ThrowsAsync<TUnitAssertionException>(async () => await TUnitAssert.That(value1).IsEqualTo(value2));
}

#if NET
[Test]
public async Task Integer_EqualsTo__With_Tolerance_Success()
{
Expand All @@ -39,4 +40,5 @@ public void Integer_EqualsTo__With_Tolerance_Failure()

NUnitAssert.ThrowsAsync<TUnitAssertionException>(async () => await TUnitAssert.That(value1).IsEqualTo(value2).Within(1));
}
#endif
}
2 changes: 2 additions & 0 deletions TUnit.Assertions.UnitTests/LongEqualsToAssertionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public void Long_EqualsTo_Failure()
NUnitAssert.ThrowsAsync<TUnitAssertionException>(async () => await TUnitAssert.That(value1).IsEqualTo(value2));
}

#if NET
[Test]
public async Task Long_EqualsTo__With_Tolerance_Success()
{
Expand All @@ -39,4 +40,5 @@ public void Long_EqualsTo__With_Tolerance_Failure()

NUnitAssert.ThrowsAsync<TUnitAssertionException>(async () => await TUnitAssert.That(value1).IsEqualTo(value2).Within(1));
}
#endif
}
11 changes: 9 additions & 2 deletions TUnit.Assertions.UnitTests/TUnit.Assertions.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<IsLibraryTestProject>true</IsLibraryTestProject>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<LangVersion>preview</LangVersion>
Expand All @@ -16,7 +17,13 @@
<PackageReference Include="coverlet.collector" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TUnit.Assertions.Analyzers\TUnit.Assertions.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\TUnit.Assertions.Analyzers\TUnit.Assertions.Analyzers.csproj"
OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\TUnit.Assertions\TUnit.Assertions.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\TUnit.Engine\PolyfillExtensions.cs">
<Link>PolyfillExtensions.cs</Link>
</Compile>
</ItemGroup>
</Project>
Loading
Loading