From 41fa7d6459f98bebe73495c07a67158a3df68f20 Mon Sep 17 00:00:00 2001 From: James A Sutherland Date: Wed, 16 Oct 2024 09:35:37 -0500 Subject: [PATCH] Add unit test for True/False wrapper logic --- Tests/FAnsiTests/Query/QuerySyntaxHelperTests.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Tests/FAnsiTests/Query/QuerySyntaxHelperTests.cs b/Tests/FAnsiTests/Query/QuerySyntaxHelperTests.cs index 59374a9d..d491747d 100644 --- a/Tests/FAnsiTests/Query/QuerySyntaxHelperTests.cs +++ b/Tests/FAnsiTests/Query/QuerySyntaxHelperTests.cs @@ -172,6 +172,18 @@ public void Test_GetAlias(DatabaseType t) }); } + [TestCaseSource(typeof(All), nameof(All.DatabaseTypes))] + public void Test_BooleanWrapper(DatabaseType dbType) + { + Assert.Multiple(() => + { + var syntaxHelper = ImplementationManager.GetImplementation(dbType).GetQuerySyntaxHelper(); + + Assert.That(syntaxHelper.True, Is.EqualTo(dbType == DatabaseType.PostgreSql ? "TRUE" : "1")); + Assert.That(syntaxHelper.False, Is.EqualTo(dbType == DatabaseType.PostgreSql ? "FALSE" : "0")); + }); + } + [TestCaseSource(typeof(All),nameof(All.DatabaseTypes))] public void Test_NameValidation(DatabaseType dbType) {