forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAbstractOperationTestCase.cs
57 lines (49 loc) · 1.36 KB
/
AbstractOperationTestCase.cs
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
57
using System.Collections;
using NHibernate.Cfg;
using NUnit.Framework;
namespace NHibernate.Test.Operations
{
public abstract class AbstractOperationTestCase : TestCase
{
protected override string MappingsAssembly
{
get { return "NHibernate.Test"; }
}
protected override string[] Mappings
{
get
{
return new[]
{
"Operations.Node.hbm.xml", "Operations.Employer.hbm.xml", "Operations.OptLockEntity.hbm.xml",
"Operations.OneToOne.hbm.xml", "Operations.Competition.hbm.xml"
};
}
}
protected override string CacheConcurrencyStrategy
{
get { return null; }
}
protected override void Configure(Configuration configuration)
{
configuration.SetProperty(Environment.GenerateStatistics, "true");
configuration.SetProperty(Environment.BatchSize, "0");
}
protected void ClearCounts()
{
Sfi.Statistics.Clear();
}
protected void AssertInsertCount(long expected)
{
Assert.That(Sfi.Statistics.EntityInsertCount, Is.EqualTo(expected), "unexpected insert count");
}
protected void AssertUpdateCount(int expected)
{
Assert.That(Sfi.Statistics.EntityUpdateCount, Is.EqualTo(expected), "unexpected update count");
}
protected void AssertDeleteCount(int expected)
{
Assert.That(Sfi.Statistics.EntityDeleteCount, Is.EqualTo(expected), "unexpected delete count");
}
}
}