Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Build/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cake" version="0.30.0" />
<package id="Cake" version="0.33.0" />
</packages>
11 changes: 9 additions & 2 deletions FluentAssertions.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.27130.2027
# Visual Studio Version 16
VisualStudioVersion = 16.0.28922.388
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E5A0B454-22D4-4694-99FF-D6A8B7DE7DA3}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -59,6 +59,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetStandard13.Specs", "Test
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "Tests\Benchmarks\Benchmarks.csproj", "{FCAFB0F1-79EA-4D49-813B-188D4BC4BE71}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetCore30.Specs", "Tests\NetCore30.Specs\NetCore30.Specs.csproj", "{05727385-DA56-4FC1-B44A-79DFECC3198A}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Tests\Shared.Specs\Shared.Specs.projitems*{0c23c12c-899f-4ad1-b737-b967a9910c08}*SharedItemsImports = 13
Expand Down Expand Up @@ -141,6 +143,10 @@ Global
{FCAFB0F1-79EA-4D49-813B-188D4BC4BE71}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FCAFB0F1-79EA-4D49-813B-188D4BC4BE71}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FCAFB0F1-79EA-4D49-813B-188D4BC4BE71}.Release|Any CPU.Build.0 = Release|Any CPU
{05727385-DA56-4FC1-B44A-79DFECC3198A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{05727385-DA56-4FC1-B44A-79DFECC3198A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{05727385-DA56-4FC1-B44A-79DFECC3198A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{05727385-DA56-4FC1-B44A-79DFECC3198A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -165,6 +171,7 @@ Global
{1E4EFB8D-FB8B-4EF2-83FC-B42D28CD99A3} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3}
{EE7509BF-A011-4D04-A91F-5AE0F92E5AB5} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3}
{FCAFB0F1-79EA-4D49-813B-188D4BC4BE71} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3}
{05727385-DA56-4FC1-B44A-79DFECC3198A} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {75DDA3D8-9D6F-4865-93F4-DDE11DEE8290}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
See https://www.fluentassertions.com for background information, usage documentation, an extensibility guide, support information and more tips & tricks.

# How do I build this?
Install Visual Studio 2017 or JetBrains Rider 2017.1 and Build Tools 2017 and run
Install Visual Studio 2019 or JetBrains Rider 2017.1 and Build Tools 2017 and run

`build.ps1`

Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("FluentAssertions")]
[assembly: AssemblyDescription("Fluent API for asserting the results of unit tests that targets .NET Framework 4.5 and 4.7, as well as .NET Core 2.0, .NET Standard 1.3, 1.6 and 2.0. " +
[assembly: AssemblyDescription("Fluent API for asserting the results of unit tests that targets .NET Framework 4.5 and 4.7, as well as .NET Core 2.0, .NET Core 3.0, .NET Standard 1.3, 1.6 and 2.0. " +
"Supports the unit test frameworks MSTest, MSTest2, Gallio, NUnit, XUnit, MBunit, MSpec, and NSpec..")]
[assembly: AssemblyCopyright("Copyright Dennis Doomen 2010-2018")]

Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/AssertionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ public static FunctionAssertions<T> Should<T>(this Func<T> func)
}


#if NET45 || NET47 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6 && !NETSTANDARD2_0

/// <summary>
/// Starts monitoring <paramref name="eventSource"/> for its events.
Expand Down
3 changes: 2 additions & 1 deletion Src/FluentAssertions/CallerIdentifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public static class CallerIdentifier
{
public static Action<string> logger = str => { };

#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6

public static string DetermineCallerIdentity()
{
string caller = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6

using System.Configuration;

Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/Common/FullFrameworkReflector.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6

using System;
using System.Collections.Generic;
Expand Down
10 changes: 5 additions & 5 deletions Src/FluentAssertions/Common/Services.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ public static IReflector Reflector

public static void ResetToDefaults()
{
#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0
reflector = new FullFrameworkReflector();
configurationStore = new AppSettingsConfigurationStore();
#if NETSTANDARD1_3
reflector = new NullReflector();
configurationStore = new NullConfigurationStore();
#elif NETSTANDARD1_6
reflector = new NetStandardReflector();
configurationStore = new NullConfigurationStore();
#else
reflector = new NullReflector();
configurationStore = new NullConfigurationStore();
reflector = new FullFrameworkReflector();
configurationStore = new AppSettingsConfigurationStore();
#endif

throwException = TestFrameworkProvider.Throw;
Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/Events/EventAssertions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET45 || NET47 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6 && !NETSTANDARD2_0

using System;
using System.ComponentModel;
Expand Down
4 changes: 2 additions & 2 deletions Src/FluentAssertions/Events/EventHandlerFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET45 || NET47 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6 && !NETSTANDARD2_0

using System;
using System.Reflection;
Expand Down Expand Up @@ -72,7 +72,7 @@ public static Delegate GenerateHandler(Type eventSignature, IEventRecorder recor
ilGen.Emit(OpCodes.Ldloc_0);

// Call the handler
ilGen.EmitCall(OpCodes.Call, methodToCall, null);
ilGen.EmitCall(OpCodes.Callvirt, methodToCall, null);

ilGen.Emit(OpCodes.Ret);

Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/Events/EventRecorder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET45 || NET47 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6 && !NETSTANDARD2_0

using System;
using System.Collections;
Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/Events/IMonitor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET45 || NET47 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6 && !NETSTANDARD2_0

using System;
using System.Reflection;
Expand Down
6 changes: 3 additions & 3 deletions Src/FluentAssertions/Execution/AssertionFailedException.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6
using System.Runtime.Serialization;
#endif

Expand All @@ -9,7 +9,7 @@ namespace FluentAssertions.Execution
/// <summary>
/// Represents the default exception in case no test framework is configured.
/// </summary>
#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6
[Serializable]
#endif

Expand All @@ -20,7 +20,7 @@ public AssertionFailedException(string message)
{
}

#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6
protected AssertionFailedException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/Execution/GallioTestFramework.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public bool IsAvailable
{
get
{
#if !NET45 && !NET47 && !NETSTANDARD2_0 && !NETCOREAPP2_0
#if NETSTANDARD1_3 || NETSTANDARD1_6
// For .NET Standard < 2.0, we need to attempt to load the assembly
try
{
Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/Execution/LateBoundTestFramework.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public bool IsAvailable
{
get
{
#if !NET45 && !NET47 && !NETSTANDARD2_0 && !NETCOREAPP2_0
#if NETSTANDARD1_3 || NETSTANDARD1_6
// For .NET Standard < 2.0, we need to attempt to load the assembly
try
{
Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/FluentAssertions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Authors>Dennis Doomen;Jonas Nyrup</Authors>
<PackageDescription>
A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or
BDD-style unit tests. Targets .NET Framework 4.5 and 4.7, as well as .NET Core 2.0, .NET Standard 1.3, 1.6 and 2.0.
BDD-style unit tests. Targets .NET Framework 4.5 and 4.7, as well as .NET Core 2.0, .NET Core 3.0, .NET Standard 1.3, 1.6 and 2.0.
Supports the unit test frameworks MSTest, MSTest2, Gallio, NUnit, XUnit, MBUnit, MSpec, and NSpec.
</PackageDescription>
<PackageProjectUrl>https://www.fluentassertions.com</PackageProjectUrl>
Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/Formatting/Formatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class Formatter

private static readonly List<IValueFormatter> defaultFormatters = new List<IValueFormatter>
{
#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6
new XmlNodeFormatter(),
#endif
new AttributeBasedFormatter(),
Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/ObjectAssertionsExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6

using System;
using System.IO;
Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/Specialized/AssemblyAssertions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public AssemblyAssertions(Assembly assembly)
Subject = assembly;
}

#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0 // TODO :: Should be able to remove based on: https://github.com/dotnet/corefx/issues/1784#issuecomment-218803619
#if !NETSTANDARD1_3 && !NETSTANDARD1_6

/// <summary>
/// Asserts that an assembly does not reference the specified assembly.
Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/Xml/XmlAssertionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6

using System.Diagnostics;
using System.Xml;
Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/Xml/XmlElementAssertions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6

using System.Diagnostics;
using System.Xml;
Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/Xml/XmlNodeAssertions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6

using System.Diagnostics;
using System.Xml;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6

using System.Diagnostics;
using System.Xml;
Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/Xml/XmlNodeFormatter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET45 || NET47 || NETSTANDARD2_0 || NETCOREAPP2_0
#if !NETSTANDARD1_3 && !NETSTANDARD1_6

using System.Xml;
using FluentAssertions.Common;
Expand Down
2 changes: 1 addition & 1 deletion Tests/Benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net471</TargetFramework>
<TargetFramework>net47</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
Expand Down
30 changes: 30 additions & 0 deletions Tests/NetCore30.Specs/NetCore30.Specs.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<AssemblyName>FluentAssertions.NetCore30.Specs</AssemblyName>
<RootNamespace>FluentAssertions.NetCore30.Specs</RootNamespace>
<CodeAnalysisRuleSet>..\..\TestRules.ruleset</CodeAnalysisRuleSet>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Chill" Version="4.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Src\FluentAssertions\FluentAssertions.csproj" />
<ProjectReference Include="..\AssemblyA\AssemblyA.csproj" />
<ProjectReference Include="..\AssemblyB\AssemblyB.csproj" />
</ItemGroup>

<Import Project="..\Shared.Specs\Shared.Specs.projitems" Label="Shared" />

</Project>
Binary file not shown.
2 changes: 1 addition & 1 deletion Tests/Shared.Specs/AssemblyAssertionSpecs.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET45 || NET47 || NETCOREAPP2_0
#if !NETCOREAPP1_1 && !NETSTANDARD1_3 && !NETSTANDARD1_6 && !NETSTANDARD2_0

using System;
using System.Reflection;
Expand Down
2 changes: 1 addition & 1 deletion Tests/Shared.Specs/AssertionScopeSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class AssertionScopeSpecsWithoutNamespace
#pragma warning restore RCS1110 // Declare type inside namespace.
{
#if NET45 || NET47 || NETCOREAPP2_0
#if !NETCOREAPP1_1 && !NETSTANDARD1_3 && !NETSTANDARD1_6 && !NETSTANDARD2_0
[Fact]
public void This_class_should_not_be_inside_a_namespace()
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Shared.Specs/BasicEquivalencySpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3344,7 +3344,7 @@ public void When_the_graph_contains_the_same_value_object_it_should_not_be_treat
act.Should().NotThrow();
}

#if NET45 || NET47 || NETCOREAPP2_0
#if !NETCOREAPP1_1 && !NETSTANDARD1_3 && !NETSTANDARD1_6 && !NETSTANDARD2_0
[Fact]
public void When_asserting_types_with_infinite_oject_graphs_are_equivilent_it_should_not_overflow_the_stack()
{
Expand Down
4 changes: 2 additions & 2 deletions Tests/Shared.Specs/EventAssertionSpecs.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET45 || NET47 || NETCOREAPP2_0
#if !NETCOREAPP1_1 && !NETSTANDARD1_3 && !NETSTANDARD1_6 && !NETSTANDARD2_0

using System;
using System.ComponentModel;
Expand Down Expand Up @@ -744,7 +744,7 @@ public void When_monitoring_an_object_through_an_interface_it_should_monitor_onl
}
}

#if NET45 || NET47
#if NET45 || NET47 // DefineDynamicAssembly is obsolete in .NET Core

[Fact]
public void When_an_object_doesnt_expose_any_events_it_should_throw()
Expand Down
8 changes: 8 additions & 0 deletions Tests/Shared.Specs/FormatterSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,11 @@ public void When_formatting_single_it_should_have_max_precision()
//-----------------------------------------------------------------------------------------------------------
// Assert
//-----------------------------------------------------------------------------------------------------------
#if NETCOREAPP3_0
result.Should().Be("0.33333334F");
#else
result.Should().Be("0.333333343F");
#endif
}

[Fact]
Expand Down Expand Up @@ -688,7 +692,11 @@ public void When_formatting_double_it_should_have_max_precision()
//-----------------------------------------------------------------------------------------------------------
// Assert
//-----------------------------------------------------------------------------------------------------------
#if NETCOREAPP3_0
result.Should().Be("0.3333333333333333");
#else
result.Should().Be("0.33333333333333331");
#endif
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion Tests/Shared.Specs/ObjectAssertionSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ public void Should_support_chaining_constraints_with_and()

#endregion

#if NET45 || NET47 || NETCOREAPP2_0
#if !NETCOREAPP1_1 && !NETSTANDARD1_3 && !NETSTANDARD1_6 && !NETSTANDARD2_0

#region BeBinarySerializable

Expand Down
2 changes: 1 addition & 1 deletion Tests/Shared.Specs/Shared.Specs.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@
<Compile Include="$(MSBuildThisFileDirectory)TestingTimer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ThrowAssertionsSpecs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)TimeSpanConversionExtensionSpecs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)TimeSpanExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)TimeSpanFormatterSpecs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)TypeAssertionSpecs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)TypeExtensionsSpecs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)TypeSelectorSpecs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Utilities.cs" />
<Compile Include="$(MSBuildThisFileDirectory)XAttributeAssertionSpecs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)XAttributeFormatterSpecs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)XDocumentAssertionSpecs.cs" />
Expand Down
Loading