|
6 | 6 |
|
7 | 7 | namespace NHibernate.Test.NHSpecificTest.NH3666
|
8 | 8 | {
|
9 |
| - [TestFixture] |
10 |
| - public class Fixture : BugTestCase |
11 |
| - { |
12 |
| - protected override void OnSetUp() |
13 |
| - { |
14 |
| - using (var session = this.OpenSession()) |
15 |
| - using (var transaction = session.BeginTransaction()) |
16 |
| - { |
17 |
| - var entity1 = new Entity { Id = 1, Property = "Test1" }; |
18 |
| - var entity2 = new Entity { Id = 2, Property = "Test2" }; |
19 |
| - var entity3 = new Entity { Id = 3, Property = "Test3" }; |
| 9 | + [TestFixture] |
| 10 | + public class Fixture : BugTestCase |
| 11 | + { |
| 12 | + protected override void OnSetUp() |
| 13 | + { |
| 14 | + using (var session = this.OpenSession()) |
| 15 | + using (var transaction = session.BeginTransaction()) |
| 16 | + { |
| 17 | + var entity1 = new Entity { Id = 1, Property = "Test1" }; |
| 18 | + var entity2 = new Entity { Id = 2, Property = "Test2" }; |
| 19 | + var entity3 = new Entity { Id = 3, Property = "Test3" }; |
20 | 20 |
|
21 |
| - session.Save(entity1); |
22 |
| - session.Save(entity2); |
23 |
| - session.Save(entity3); |
| 21 | + session.Save(entity1); |
| 22 | + session.Save(entity2); |
| 23 | + session.Save(entity3); |
24 | 24 |
|
25 |
| - transaction.Commit(); |
26 |
| - } |
27 |
| - } |
| 25 | + transaction.Commit(); |
| 26 | + } |
| 27 | + } |
28 | 28 |
|
29 |
| - protected override void OnTearDown() |
30 |
| - { |
31 |
| - using (var session = this.OpenSession()) |
32 |
| - using (var transaction = session.BeginTransaction()) |
33 |
| - { |
34 |
| - session.Delete("from Entity"); |
35 |
| - transaction.Commit(); |
36 |
| - } |
37 |
| - } |
| 29 | + protected override void OnTearDown() |
| 30 | + { |
| 31 | + using (var session = this.OpenSession()) |
| 32 | + using (var transaction = session.BeginTransaction()) |
| 33 | + { |
| 34 | + session.Delete("from Entity"); |
| 35 | + transaction.Commit(); |
| 36 | + } |
| 37 | + } |
38 | 38 |
|
39 |
| - [Test] |
40 |
| - public void CacheableDoesNotThrowExceptionWithNativeSQLQuery() |
41 |
| - { |
42 |
| - using (var session = this.OpenSession()) |
43 |
| - using (var transaction = session.BeginTransaction()) |
44 |
| - { |
45 |
| - var result = session.CreateSQLQuery("SELECT * FROM Entity WHERE Property = 'Test2'") |
46 |
| - .AddEntity(typeof(Entity)) |
47 |
| - .SetCacheable(true) |
48 |
| - .List<Entity>(); |
| 39 | + [Test] |
| 40 | + public void CacheableDoesNotThrowExceptionWithNativeSQLQuery() |
| 41 | + { |
| 42 | + using (var session = this.OpenSession()) |
| 43 | + using (var transaction = session.BeginTransaction()) |
| 44 | + { |
| 45 | + var result = session.CreateSQLQuery("SELECT * FROM Entity WHERE Property = 'Test2'") |
| 46 | + .AddEntity(typeof(Entity)) |
| 47 | + .SetCacheable(true) |
| 48 | + .List<Entity>(); |
49 | 49 |
|
50 |
| - CollectionAssert.IsNotEmpty(result); |
| 50 | + CollectionAssert.IsNotEmpty(result); |
51 | 51 |
|
52 |
| - Assert.AreEqual(1, result.Count); |
53 |
| - Assert.AreEqual(2, result[0].Id); |
54 |
| - } |
55 |
| - } |
| 52 | + Assert.AreEqual(1, result.Count); |
| 53 | + Assert.AreEqual(2, result[0].Id); |
| 54 | + } |
| 55 | + } |
56 | 56 |
|
57 |
| - [Test] |
58 |
| - public void CacheableDoesNotThrowExceptionWithNamedQuery() |
59 |
| - { |
60 |
| - using (var session = this.OpenSession()) |
61 |
| - using (var transaction = session.BeginTransaction()) |
62 |
| - { |
63 |
| - var result = session.GetNamedQuery("QueryName") |
64 |
| - .SetCacheable(true) |
65 |
| - .SetString("prop", "Test2") |
66 |
| - .List<Entity>(); |
| 57 | + [Test] |
| 58 | + public void CacheableDoesNotThrowExceptionWithNamedQuery() |
| 59 | + { |
| 60 | + using (var session = this.OpenSession()) |
| 61 | + using (var transaction = session.BeginTransaction()) |
| 62 | + { |
| 63 | + var result = session.GetNamedQuery("QueryName") |
| 64 | + .SetCacheable(true) |
| 65 | + .SetString("prop", "Test2") |
| 66 | + .List<Entity>(); |
67 | 67 |
|
68 |
| - CollectionAssert.IsNotEmpty(result); |
| 68 | + CollectionAssert.IsNotEmpty(result); |
69 | 69 |
|
70 |
| - Assert.AreEqual(1, result.Count); |
71 |
| - Assert.AreEqual(2, result[0].Id); |
72 |
| - } |
73 |
| - } |
74 |
| - } |
| 70 | + Assert.AreEqual(1, result.Count); |
| 71 | + Assert.AreEqual(2, result[0].Id); |
| 72 | + } |
| 73 | + } |
| 74 | + } |
75 | 75 | }
|
0 commit comments