提交 5b4c4368 编写于 作者: K Kevin Pullin

Commit DbString.DefaultStringDbType test

上级 7062416c
......@@ -1112,6 +1112,35 @@ public void TestDbString()
((int)obj.f).IsEqualTo(10);
}
public void TestDefaultDbStringDbType()
{
var origDefaultStringDbType = DbString.DefaultStringDbType;
try
{
DbString.DefaultStringDbType = DbType.AnsiString;
var a = new DbString { Value = "abcde" };
var b = new DbString { Value = "abcde", IsAnsi = false };
a.IsAnsi.IsTrue();
b.IsAnsi.IsFalse();
var exceptionThrow = false;
try
{
DbString.DefaultStringDbType = DbType.Int32;
}
catch
{
exceptionThrow = true;
}
exceptionThrow.IsTrue();
}
finally
{
DbString.DefaultStringDbType = origDefaultStringDbType;
}
}
class Person
{
public int PersonId { get; set; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册