miniSql

创建
zgc123@gmail.com authored at 11/19/2023 1:40:15 AM
6136600
Tree
0 Parent(s)
Summary: 1 changed files with 49 additions and 0 deletions.
Added +49 -0
Added +49 -0
diff --git a/minisqlquery-master/src/MiniSqlQuery.Tests/TextGeneratorService_Tests.cs b/minisqlquery-master/src/MiniSqlQuery.Tests/TextGeneratorService_Tests.cs
new file mode 100644
index 0000000..8120c4d
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery.Tests/TextGeneratorService_Tests.cs
@@ -0,0 +1,49 @@
+using MiniSqlQuery.PlugIns.TextGenerator;
+using NUnit.Framework;
+
+
+// ReSharper disable InconsistentNaming
+
+namespace MiniSqlQuery.Tests
+{
+    [TestFixture]
+    public class TextGeneratorService_Tests
+    {
+        [Test]
+        public void Simple_text_gen()
+        {
+            var gen = new TextGeneratorService();
+            string result = gen.Process("ClassName\r\n Foo\r\n Bar");
+            Assert.That(result, Is.EqualTo(@"public class ClassName
+{
+public virtual string Foo { get; set; }
+public virtual string Bar { get; set; }
+}
+"));
+        }
+
+        [Test]
+        public void Simple_text_gen_converts_to_PascalCase()
+        {
+            var gen = new TextGeneratorService();
+            string result = gen.Process("Some other class\r\n Ba da bing");
+            Assert.That(result, Is.EqualTo(@"public class SomeOtherClass
+{
+public virtual string BaDaBing { get; set; }
+}
+"));
+        }
+
+        [Test]
+        public void if_a_property_ends_with_Id_its_an_int()
+        {
+            var gen = new TextGeneratorService();
+            string result = gen.Process("Some other class\r\n My Id");
+            Assert.That(result, Is.EqualTo(@"public class SomeOtherClass
+{
+public virtual int MyId { get; set; }
+}
+"));
+        }
+    }
+}
\ No newline at end of file