forked from praeclarum/sqlite-net
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathUnicodeTest.cs
More file actions
56 lines (42 loc) · 1.16 KB
/
UnicodeTest.cs
File metadata and controls
56 lines (42 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Linq;
#if NETFX_CORE
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using SetUp = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestInitializeAttribute;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#else
using NUnit.Framework;
#endif
namespace SQLite.Tests
{
[TestFixture]
public class UnicodeTest
{
[Test]
public void Insert ()
{
var db = new TestDb ();
db.CreateTable<Product> ();
string testString = "\u2329\u221E\u232A";
db.Insert (new Product {
Name = testString,
});
var p = db.Get<Product> (1);
Assert.AreEqual (testString, p.Name);
}
[Test]
public void Query ()
{
var db = new TestDb ();
db.CreateTable<Product> ();
string testString = "\u2329\u221E\u232A";
db.Insert (new Product {
Name = testString,
});
var ps = (from p in db.Table<Product> () where p.Name == testString select p).ToList ();
Assert.AreEqual (1, ps.Count);
Assert.AreEqual (testString, ps [0].Name);
}
}
}