本文整理汇总了C#中SQLite.Tests.TestDb.GetTableInfo方法的典型用法代码示例。如果您正苦于以下问题:C# TestDb.GetTableInfo方法的具体用法?C# TestDb.GetTableInfo怎么用?C# TestDb.GetTableInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLite.Tests.TestDb
的用法示例。
在下文中一共展示了TestDb.GetTableInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpperAndLowerColumnNames
public void UpperAndLowerColumnNames()
{
using (var db = new TestDb (true) { Trace = true } ) {
db.CreateTable<LowerId> ();
db.CreateTable<UpperId> ();
var cols = db.GetTableInfo ("Test").ToList ();
Assert.That (cols.Count, Is.EqualTo (1));
Assert.That (cols[0].Name, Is.EqualTo ("Id"));
}
}
示例2: UpperAndLowerColumnNames
public void UpperAndLowerColumnNames()
{
using (var db = new TestDb (true) { Trace = true } ) {
db.CreateTable<LowerId> ();
db.CreateTable<UpperId> ();
var cols = db.GetTableInfo ("Test").ToList ();
Assert.AreEqual (1, cols.Count);
Assert.AreEqual ("Id", cols[0].Name);
}
}
示例3: PrimaryKeyHasNotNullConstraint
public void PrimaryKeyHasNotNullConstraint ()
{
using (TestDb db = new TestDb ()) {
db.CreateTable<ClassWithPK> ();
var cols = db.GetTableInfo ("ClassWithPK");
var joined = from expected in GetExpectedColumnInfos (typeof (ClassWithPK))
join actual in cols on expected.Name equals actual.Name
where actual.notnull != expected.notnull
select actual.Name;
Assert.AreNotEqual (0, cols.Count (), "Failed to get table info");
Assert.IsTrue (joined.Count () == 0, string.Format ("not null constraint was not created for the following properties: {0}"
, string.Join (", ", joined.ToArray ())));
}
}