0
|
1 using System;
|
|
2 using System.Linq;
|
|
3
|
|
4 using BLToolkit.Data.Linq;
|
|
5
|
|
6 using NUnit.Framework;
|
|
7
|
|
8 namespace Data.Linq
|
|
9 {
|
|
10 using Model;
|
|
11
|
|
12 [TestFixture]
|
|
13 public class ExtensionTests : TestBase
|
|
14 {
|
|
15 public class ParenTable
|
|
16 {
|
|
17 public int ParentID;
|
|
18 public int? Value1;
|
|
19 }
|
|
20
|
|
21 [Test]
|
|
22 public void TableName([IncludeDataContexts("Sql2008", "Sql2012")] string context)
|
|
23 {
|
|
24 using (var db = new TestDbManager(context))
|
|
25 db.GetTable<ParenTable>().TableName("Parent").ToList();
|
|
26 }
|
|
27
|
|
28 [Test]
|
|
29 public void DatabaseName([IncludeDataContexts("Sql2008")] string context)
|
|
30 {
|
|
31 using (var db = new TestDbManager(context))
|
|
32 db.GetTable<Parent>().DatabaseName("TestData").ToList();
|
|
33 }
|
|
34
|
|
35 [Test]
|
|
36 public void OwnerName([IncludeDataContexts("Sql2008", "Sql2012")] string context)
|
|
37 {
|
|
38 using (var db = new TestDbManager(context))
|
|
39 db.GetTable<Parent>().OwnerName("dbo").ToList();
|
|
40 }
|
|
41
|
|
42 [Test]
|
|
43 public void AllNames([IncludeDataContexts("Sql2008")] string context)
|
|
44 {
|
|
45 using (var db = new TestDbManager(context))
|
|
46 db.GetTable<ParenTable>()
|
|
47 .DatabaseName("TestData")
|
|
48 .OwnerName("dbo")
|
|
49 .TableName("Parent")
|
|
50 .ToList();
|
|
51 }
|
|
52 }
|
|
53 }
|