Browse Source

Updated tests to use FluentAssertions 6

Marcin Ziąbek 4 years ago
parent
commit
cc6d1c81c8

+ 4 - 4
QuestPDF.UnitTests/GridTests.cs

@@ -63,7 +63,7 @@ namespace QuestPDF.UnitTests
                 });
             });
             
-            structure.Should().BeEquivalentTo(expected, o => o.WithTracing().WithAutoConversion().WithStrictOrdering().IncludingAllRuntimeProperties());
+            structure.Should().BeEquivalentTo(expected);
         }
         
         [Test]
@@ -120,7 +120,7 @@ namespace QuestPDF.UnitTests
                 });
             });
 
-            structure.Should().BeEquivalentTo(expected, o => o.WithTracing().WithAutoConversion().WithStrictOrdering().IncludingAllRuntimeProperties());
+            structure.Should().BeEquivalentTo(expected);
         }
         
         [Test]
@@ -174,7 +174,7 @@ namespace QuestPDF.UnitTests
                 });
             });
             
-            structure.Should().BeEquivalentTo(expected, o => o.WithTracing().WithAutoConversion().WithStrictOrdering().IncludingAllRuntimeProperties());
+            structure.Should().BeEquivalentTo(expected);
         }
         
         #endregion
@@ -244,7 +244,7 @@ namespace QuestPDF.UnitTests
                 });
             });
             
-            structure.Should().BeEquivalentTo(expected, o => o.WithTracing().WithAutoConversion().WithStrictOrdering().IncludingAllRuntimeProperties().AllowingInfiniteRecursion());
+            structure.Should().BeEquivalentTo(expected);
         }
         
         #endregion

+ 1 - 1
QuestPDF.UnitTests/QuestPDF.UnitTests.csproj

@@ -6,7 +6,7 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="FluentAssertions" Version="5.10.3" />
+        <PackageReference Include="FluentAssertions" Version="6.1.0" />
         <PackageReference Include="Moq" Version="4.13.1" />
         <PackageReference Include="nunit" Version="3.13.2" />
         <PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />

+ 21 - 0
QuestPDF.UnitTests/TestsBase.cs

@@ -0,0 +1,21 @@
+using FluentAssertions;
+using NUnit.Framework;
+
+namespace QuestPDF.UnitTests
+{
+    [SetUpFixture]
+    public class TestsBase
+    {
+        [OneTimeSetUp]
+        public void RunBeforeAnyTests()
+        {
+            AssertionOptions.AssertEquivalencyUsing(options => options
+                .IncludingNestedObjects()
+                .IncludingInternalProperties()
+                .AllowingInfiniteRecursion()
+                .RespectingRuntimeTypes()
+                .WithTracing()
+                .WithStrictOrdering());
+        }
+    }
+}