refactor(tests): migrate Database.Tests from FluentAssertions to Shouldly

Replace FluentAssertions with Shouldly across all 6 test files (94 tests).
Add ShouldlyExtensions for BeCloseTo and BeEquivalentTo patterns.
This commit is contained in:
Joseph Doherty
2026-01-29 14:40:18 -05:00
parent 04383d672c
commit 1e23616638
9 changed files with 223 additions and 152 deletions
@@ -1,7 +1,7 @@
using Dapper;
using FluentAssertions;
using JdeScoping.Core.Models.Search;
using JdeScoping.Database.Tests.Infrastructure;
using Shouldly;
namespace JdeScoping.Database.Tests.Functions;
@@ -28,7 +28,7 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = searchId });
// Assert
result.Should().BeCloseTo(expectedDate, TimeSpan.FromSeconds(1));
result.ShouldBeCloseTo(expectedDate, TimeSpan.FromSeconds(1));
}
[Fact]
@@ -44,7 +44,7 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = searchId });
// Assert
result.Should().BeNull();
result.ShouldBeNull();
}
[Fact]
@@ -56,7 +56,7 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = 99999 });
// Assert
result.Should().BeNull();
result.ShouldBeNull();
}
[Fact]
@@ -71,7 +71,7 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = searchId });
// Assert
result.Should().BeNull();
result.ShouldBeNull();
}
[Fact]
@@ -86,7 +86,7 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = searchId });
// Assert
result.Should().BeNull();
result.ShouldBeNull();
}
#endregion
@@ -107,7 +107,7 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = searchId });
// Assert
result.Should().BeCloseTo(expectedDate, TimeSpan.FromSeconds(1));
result.ShouldBeCloseTo(expectedDate, TimeSpan.FromSeconds(1));
}
[Fact]
@@ -123,7 +123,7 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = searchId });
// Assert
result.Should().BeNull();
result.ShouldBeNull();
}
[Fact]
@@ -135,7 +135,7 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = 99999 });
// Assert
result.Should().BeNull();
result.ShouldBeNull();
}
[Fact]
@@ -150,7 +150,7 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = searchId });
// Assert
result.Should().BeNull();
result.ShouldBeNull();
}
[Fact]
@@ -165,7 +165,7 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = searchId });
// Assert
result.Should().BeNull();
result.ShouldBeNull();
}
#endregion
@@ -185,7 +185,8 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = searchId });
// Assert
result.Should().BeTrue();
result.ShouldNotBeNull();
result.Value.ShouldBeTrue();
}
[Fact]
@@ -201,7 +202,8 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = searchId });
// Assert
result.Should().BeFalse();
result.ShouldNotBeNull();
result.Value.ShouldBeFalse();
}
[Fact]
@@ -213,7 +215,7 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = 99999 });
// Assert
result.Should().BeNull();
result.ShouldBeNull();
}
[Fact]
@@ -228,7 +230,7 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = searchId });
// Assert
result.Should().BeNull();
result.ShouldBeNull();
}
[Fact]
@@ -243,7 +245,7 @@ public class ScalarFunctionTests : DatabaseTestBase
new { SearchId = searchId });
// Assert
result.Should().BeNull();
result.ShouldBeNull();
}
#endregion