From 576a6b22bbbc8abda3eef18eb344660ad3767c2c Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 16 Oct 2021 07:53:29 +1100 Subject: [PATCH] NET461 tests --- docs/serializer-settings.md | 38 +++++++++---------- readme.md | 2 +- src/Verify.Expecto/Verifier_Tuple.cs | 2 +- src/Verify.Expecto/Verify.Expecto.csproj | 8 ++-- src/Verify.MSTest/Verify.MSTest.csproj | 8 ++-- src/Verify.MSTest/VerifyBase_Tuple.cs | 2 +- src/Verify.NUnit/Verifier_Tuple.cs | 2 +- src/Verify.NUnit/Verify.NUnit.csproj | 8 ++-- src/Verify.NUnit/VerifyBase_Tuple.cs | 2 +- ...FrameworkAndVersion.DotNet4_6.verified.txt | 1 + ...orkAndVersionFluent.DotNet4_6.verified.txt | 1 + .../Serialization/SerializationTests.cs | 5 ++- src/Verify.Tests/Verify.Tests.csproj | 4 +- src/Verify.Xunit/Verifier_Tuple.cs | 2 +- src/Verify.Xunit/Verify.Xunit.csproj | 8 ++-- src/Verify.Xunit/VerifyBase_Tuple.cs | 2 +- src/Verify/Serialization/TupleConverter.cs | 2 +- src/Verify/Verifier/InnerVerifier_Tuple.cs | 4 +- src/Verify/Verify.csproj | 10 ++--- 19 files changed, 56 insertions(+), 55 deletions(-) create mode 100644 src/Verify.Tests/Naming/NamerTests.TargetFrameworkAndVersion.DotNet4_6.verified.txt create mode 100644 src/Verify.Tests/Naming/NamerTests.TargetFrameworkAndVersionFluent.DotNet4_6.verified.txt diff --git a/docs/serializer-settings.md b/docs/serializer-settings.md index 3d25e91392..01368e0ebe 100644 --- a/docs/serializer-settings.md +++ b/docs/serializer-settings.md @@ -184,7 +184,7 @@ var target = new GuidTarget await Verifier.Verify(target); ``` -snippet source | anchor +snippet source | anchor Results in the following: @@ -595,7 +595,7 @@ public Task ScopedSerializerFluent() _ => { _.TypeNameHandling = TypeNameHandling.All; }); } ``` -snippet source | anchor +snippet source | anchor Result: @@ -658,7 +658,7 @@ public Task IgnoreTypeFluent() } ``` -snippet source | anchor +snippet source | anchor Or globally: @@ -669,7 +669,7 @@ Or globally: VerifierSettings.ModifySerialization( _ => _.IgnoreMembersWithType()); ``` -snippet source | anchor +snippet source | anchor Result: @@ -733,7 +733,7 @@ public Task AddIgnoreInstanceFluent() _ => { _.IgnoreInstance(x => x.Property == "Ignore"); }); } ``` -snippet source | anchor +snippet source | anchor Or globally: @@ -744,7 +744,7 @@ Or globally: VerifierSettings.ModifySerialization( _ => { _.IgnoreInstance(x => x.Property == "Ignore"); }); ``` -snippet source | anchor +snippet source | anchor Result: @@ -788,7 +788,7 @@ public Task WithObsoleteProp() return Verifier.Verify(target); } ``` -snippet source | anchor +snippet source | anchor Result: @@ -836,7 +836,7 @@ public Task WithObsoletePropIncludedFluent() .ModifySerialization(_ => { _.IncludeObsoletes(); }); } ``` -snippet source | anchor +snippet source | anchor Or globally: @@ -846,7 +846,7 @@ Or globally: ```cs VerifierSettings.ModifySerialization(_ => { _.IncludeObsoletes(); }); ``` -snippet source | anchor +snippet source | anchor Result: @@ -911,7 +911,7 @@ public Task IgnoreMemberByExpressionFluent() }); } ``` -snippet source | anchor +snippet source | anchor Or globally @@ -928,7 +928,7 @@ VerifierSettings.ModifySerialization(_ => _.IgnoreMember(x => x.PropertyThatThrows); }); ``` -snippet source | anchor +snippet source | anchor Result: @@ -996,7 +996,7 @@ public Task IgnoreMemberByNameFluent() }); } ``` -snippet source | anchor +snippet source | anchor Or globally: @@ -1014,7 +1014,7 @@ VerifierSettings.ModifySerialization(_ => _.IgnoreMember(type, "PropertyThatThrows"); }); ``` -snippet source | anchor +snippet source | anchor Result: @@ -1060,7 +1060,7 @@ public Task CustomExceptionPropFluent() .ModifySerialization(_ => _.IgnoreMembersThatThrow()); } ``` -snippet source | anchor +snippet source | anchor Or globally: @@ -1070,7 +1070,7 @@ Or globally: ```cs VerifierSettings.ModifySerialization(_ => _.IgnoreMembersThatThrow()); ``` -snippet source | anchor +snippet source | anchor Result: @@ -1109,7 +1109,7 @@ public Task ExceptionMessagePropFluent() _ => _.IgnoreMembersThatThrow(x => x.Message == "Ignore")); } ``` -snippet source | anchor +snippet source | anchor Or globally: @@ -1120,7 +1120,7 @@ Or globally: VerifierSettings.ModifySerialization( _ => _.IgnoreMembersThatThrow(x => x.Message == "Ignore")); ``` -snippet source | anchor +snippet source | anchor Result: @@ -1273,7 +1273,7 @@ public Task MemberConverterByExpressionFluent() }); } ``` -snippet source | anchor +snippet source | anchor This can also be configured globally: @@ -1291,7 +1291,7 @@ VerifierSettings.ModifySerialization(_ => (target, value) => value + "Suffix"); }); ``` -snippet source | anchor +snippet source | anchor diff --git a/readme.md b/readme.md index 3dddeb90be..94e90923a7 100644 --- a/readme.md +++ b/readme.md @@ -335,7 +335,7 @@ public Task VerifyJsonJToken() return Verifier.VerifyJson(target); } ``` -snippet source | anchor +snippet source | anchor Results in: diff --git a/src/Verify.Expecto/Verifier_Tuple.cs b/src/Verify.Expecto/Verifier_Tuple.cs index 9d764217b9..d2843d54fc 100644 --- a/src/Verify.Expecto/Verifier_Tuple.cs +++ b/src/Verify.Expecto/Verifier_Tuple.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET461 using System.Linq.Expressions; using VerifyTests; diff --git a/src/Verify.Expecto/Verify.Expecto.csproj b/src/Verify.Expecto/Verify.Expecto.csproj index 3b37e2670a..bc91d1f92b 100644 --- a/src/Verify.Expecto/Verify.Expecto.csproj +++ b/src/Verify.Expecto/Verify.Expecto.csproj @@ -4,16 +4,16 @@ $(NoWarn);CS0436 - netstandard2.0;netstandard2.1;net461;net5;net6 + netstandard2.0;netstandard2.1;net461;net472;net5;net6 - - - + + + diff --git a/src/Verify.MSTest/Verify.MSTest.csproj b/src/Verify.MSTest/Verify.MSTest.csproj index 2d7300bef9..ce43aa3728 100644 --- a/src/Verify.MSTest/Verify.MSTest.csproj +++ b/src/Verify.MSTest/Verify.MSTest.csproj @@ -4,16 +4,16 @@ $(NoWarn);CS0436 - netstandard2.0;netstandard2.1;net461;net5;net6 + netstandard2.0;netstandard2.1;net461;net472;net5;net6 - - - + + + diff --git a/src/Verify.MSTest/VerifyBase_Tuple.cs b/src/Verify.MSTest/VerifyBase_Tuple.cs index b49defa643..1f36bcda8c 100644 --- a/src/Verify.MSTest/VerifyBase_Tuple.cs +++ b/src/Verify.MSTest/VerifyBase_Tuple.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET461 using System.Linq.Expressions; using VerifyTests; diff --git a/src/Verify.NUnit/Verifier_Tuple.cs b/src/Verify.NUnit/Verifier_Tuple.cs index f2f6c6adaa..fa2dda366f 100644 --- a/src/Verify.NUnit/Verifier_Tuple.cs +++ b/src/Verify.NUnit/Verifier_Tuple.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET461 using System.Linq.Expressions; using VerifyTests; diff --git a/src/Verify.NUnit/Verify.NUnit.csproj b/src/Verify.NUnit/Verify.NUnit.csproj index 8b5f3a773c..3376ccbb00 100644 --- a/src/Verify.NUnit/Verify.NUnit.csproj +++ b/src/Verify.NUnit/Verify.NUnit.csproj @@ -3,16 +3,16 @@ netstandard2.0;netstandard2.1;net5;net6 - netstandard2.0;netstandard2.1;net461;net5;net6 + netstandard2.0;netstandard2.1;net461;net472;net5;net6 - - - + + + diff --git a/src/Verify.NUnit/VerifyBase_Tuple.cs b/src/Verify.NUnit/VerifyBase_Tuple.cs index e1a1ec2e24..d7dbfcff83 100644 --- a/src/Verify.NUnit/VerifyBase_Tuple.cs +++ b/src/Verify.NUnit/VerifyBase_Tuple.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET461 using System.Linq.Expressions; using VerifyTests; diff --git a/src/Verify.Tests/Naming/NamerTests.TargetFrameworkAndVersion.DotNet4_6.verified.txt b/src/Verify.Tests/Naming/NamerTests.TargetFrameworkAndVersion.DotNet4_6.verified.txt new file mode 100644 index 0000000000..9f26b637f0 --- /dev/null +++ b/src/Verify.Tests/Naming/NamerTests.TargetFrameworkAndVersion.DotNet4_6.verified.txt @@ -0,0 +1 @@ +Foo \ No newline at end of file diff --git a/src/Verify.Tests/Naming/NamerTests.TargetFrameworkAndVersionFluent.DotNet4_6.verified.txt b/src/Verify.Tests/Naming/NamerTests.TargetFrameworkAndVersionFluent.DotNet4_6.verified.txt new file mode 100644 index 0000000000..9f26b637f0 --- /dev/null +++ b/src/Verify.Tests/Naming/NamerTests.TargetFrameworkAndVersionFluent.DotNet4_6.verified.txt @@ -0,0 +1 @@ +Foo \ No newline at end of file diff --git a/src/Verify.Tests/Serialization/SerializationTests.cs b/src/Verify.Tests/Serialization/SerializationTests.cs index bea343e1b5..e2dd7efcd3 100644 --- a/src/Verify.Tests/Serialization/SerializationTests.cs +++ b/src/Verify.Tests/Serialization/SerializationTests.cs @@ -877,7 +877,7 @@ public async Task ShouldUseShortTypeName() #endregion } -#if(!NETSTANDARD2_0) +#if(!NETSTANDARD2_0 && !NET461) [Fact] public async Task NamedTuple() { @@ -896,7 +896,7 @@ public async Task NamedTuple() } #endregion - +#if !NET461 [Fact] public async Task PartialNamedTuple() { @@ -904,6 +904,7 @@ public async Task PartialNamedTuple() PrefixUnique.Clear(); await Verifier.Verify(exception.Message); } +#endif static (bool, string Member2, string Member3) MethodWithPartialNamedTuple() { diff --git a/src/Verify.Tests/Verify.Tests.csproj b/src/Verify.Tests/Verify.Tests.csproj index 1f787432e2..504d447717 100644 --- a/src/Verify.Tests/Verify.Tests.csproj +++ b/src/Verify.Tests/Verify.Tests.csproj @@ -7,7 +7,7 @@ $(NoWarn);CS8002 - net48;net6 + net461;net48;net6 @@ -27,7 +27,7 @@ - + PreserveNewest diff --git a/src/Verify.Xunit/Verifier_Tuple.cs b/src/Verify.Xunit/Verifier_Tuple.cs index 4ff5673e6b..d6edb35e77 100644 --- a/src/Verify.Xunit/Verifier_Tuple.cs +++ b/src/Verify.Xunit/Verifier_Tuple.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET461 using System.Linq.Expressions; using VerifyTests; diff --git a/src/Verify.Xunit/Verify.Xunit.csproj b/src/Verify.Xunit/Verify.Xunit.csproj index 7d451d59f3..f718e1bd98 100644 --- a/src/Verify.Xunit/Verify.Xunit.csproj +++ b/src/Verify.Xunit/Verify.Xunit.csproj @@ -4,7 +4,7 @@ $(NoWarn);CS0436 - netstandard2.0;netstandard2.1;net461;net5;net6 + netstandard2.0;netstandard2.1;net461;net472;net5;net6 @@ -13,9 +13,9 @@ - - - + + + diff --git a/src/Verify.Xunit/VerifyBase_Tuple.cs b/src/Verify.Xunit/VerifyBase_Tuple.cs index 6fa8a72eb1..c44defdf79 100644 --- a/src/Verify.Xunit/VerifyBase_Tuple.cs +++ b/src/Verify.Xunit/VerifyBase_Tuple.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET461 using System.Linq.Expressions; using VerifyTests; diff --git a/src/Verify/Serialization/TupleConverter.cs b/src/Verify/Serialization/TupleConverter.cs index b396682f97..f5748c7251 100644 --- a/src/Verify/Serialization/TupleConverter.cs +++ b/src/Verify/Serialization/TupleConverter.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET461 using System.Linq.Expressions; static class TupleConverter diff --git a/src/Verify/Verifier/InnerVerifier_Tuple.cs b/src/Verify/Verifier/InnerVerifier_Tuple.cs index 01803cd884..0ebe9d0168 100644 --- a/src/Verify/Verifier/InnerVerifier_Tuple.cs +++ b/src/Verify/Verifier/InnerVerifier_Tuple.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET461 using System.Linq.Expressions; partial class InnerVerifier @@ -9,6 +9,4 @@ public Task VerifyTuple(Expression> target) return Verify(dictionary); } } - - #endif \ No newline at end of file diff --git a/src/Verify/Verify.csproj b/src/Verify/Verify.csproj index 26705121cd..8d557f293b 100644 --- a/src/Verify/Verify.csproj +++ b/src/Verify/Verify.csproj @@ -3,20 +3,20 @@ netstandard2.0;netstandard2.1;net5;net6 - netstandard2.0;netstandard2.1;net461;net5;net6 + netstandard2.0;netstandard2.1;net461;net472;net5;net6 - + - - - + + +