miniSql

创建
zgc123@gmail.com authored at 11/19/2023 1:40:15 AM
6136600
Tree
0 Parent(s)
Summary: 1 changed files with 41 additions and 0 deletions.
Added +41 -0
Added +41 -0
diff --git a/minisqlquery-master/src/MiniSqlQuery.Tests/TextFormater_tests.cs b/minisqlquery-master/src/MiniSqlQuery.Tests/TextFormater_tests.cs
new file mode 100644
index 0000000..199fff2
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery.Tests/TextFormater_tests.cs
@@ -0,0 +1,41 @@
+using System;
+using MiniSqlQuery.Core.Template;
+using NUnit.Framework;
+using NUnit.Framework.SyntaxHelpers;
+
+namespace MiniSqlQuery.Tests
+{
+	[TestFixture]
+	public class TextFormater_tests
+	{
+		private class MyClass
+		{
+			public string Name{get;set;}
+			public DateTime Time { get; set; }
+			public int Age { get; set; }
+		}
+
+		ITextFormatter _formatter;
+
+		[SetUp]
+		public void TestSetUp()
+		{
+			_formatter = new HenriFormatter();
+		}
+
+		[Test]
+		public void Unchanged()
+		{
+			string text = _formatter.Format("nothing", null);
+			Assert.That(text, Is.EqualTo("nothing"));
+		}
+
+		[Test]
+		public void Accepts_values()
+		{
+			MyClass o = new MyClass { Name = "Blue", Age = 32 };
+			string text = _formatter.Format("Mr {Name} arrived, aged {Age}.", o);
+			Assert.That(text, Is.EqualTo("Mr Blue arrived, aged 32."));
+		}
+	}
+}
\ No newline at end of file