comparison UnitTests/Linq/UserTests/UnknownSqlTest.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
1 using System;
2 using System.Linq;
3
4 using BLToolkit.Data.Linq;
5
6 using NUnit.Framework;
7
8 namespace Data.Linq.UserTests
9 {
10 [TestFixture]
11 public class UnknownSqlTest : TestBase
12 {
13 enum ColumnDataType
14 {
15 Unknown = 0,
16 Text = 1,
17 }
18
19 class CustomTableColumn
20 {
21 public int? DataTypeID { get; set; }
22 }
23
24 [Test]
25 public void Test()
26 {
27 using (var db = new TestDbManager())
28 {
29 var q = db.GetTable<CustomTableColumn>()
30 .Select(
31 x => new
32 {
33 DataType = Sql.AsSql(ColumnDataType.Unknown),
34 });
35
36 var sql = q.ToString();
37
38 Assert.That(sql, Is.Not.Contains("Unknown"));
39 }
40 }
41 }
42 }