miniSql

创建
zgc123@gmail.com authored at 11/19/2023 1:40:15 AM
6136600
Tree
0 Parent(s)
Summary: 1 changed files with 21 additions and 0 deletions.
Added +21 -0
Added +21 -0
diff --git a/minisqlquery-master/src/MiniSqlQuery.Tests/Utility_Tests.cs b/minisqlquery-master/src/MiniSqlQuery.Tests/Utility_Tests.cs
new file mode 100644
index 0000000..4450175
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery.Tests/Utility_Tests.cs
@@ -0,0 +1,21 @@
+using MiniSqlQuery.Core;
+using NUnit.Framework;
+
+
+namespace MiniSqlQuery.Tests
+{
+    [TestFixture]
+    public class Utility_Tests
+    {
+        [Test]
+        public void RenderSafeSchemaObjectName()
+        {
+            Assert.That(Utility.RenderSafeSchemaObjectName(null, "table"), Is.EqualTo("[table]"));
+            Assert.That(Utility.RenderSafeSchemaObjectName("", "table"), Is.EqualTo("[table]"));
+            Assert.That(Utility.RenderSafeSchemaObjectName("dbo", "table"), Is.EqualTo("[dbo].[table]"));
+            Assert.That(Utility.RenderSafeSchemaObjectName("dbo", "table name"), Is.EqualTo("[dbo].[table name]"));
+            Assert.That(Utility.RenderSafeSchemaObjectName("some schema", "table name"), Is.EqualTo("[some schema].[table name]"));
+            Assert.That(Utility.RenderSafeSchemaObjectName("rights", "Right"), Is.EqualTo("[rights].[Right]"));
+        }
+    }
+}
\ No newline at end of file