forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimpleOneToManyTest.cs
50 lines (45 loc) · 1.33 KB
/
SimpleOneToManyTest.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
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by AsyncGenerator.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Collections;
using NUnit.Framework;
namespace NHibernate.Test.ListIndex
{
using System.Threading.Tasks;
[TestFixture]
public class SimpleOneToManyTestAsync : TestCase
{
protected override IList Mappings
{
get { return new string[] { "ListIndex.SimpleOneToMany.hbm.xml" }; }
}
protected override string MappingsAssembly
{
get { return "NHibernate.Test"; }
}
[Test]
public async Task ShouldIncludeTheListIdxInsertingAsync()
{
using (var s = OpenSession())
using (var tx = s.BeginTransaction())
{
var galery = new Galery();
galery.Images.Add(new Image {Path = "image01.jpg"});
await (s.PersistAsync(galery));
Assert.DoesNotThrowAsync(() => tx.CommitAsync());
}
using (var s = OpenSession())
using (var tx = s.BeginTransaction())
{
await (s.CreateQuery("delete from Image").ExecuteUpdateAsync());
await (s.CreateQuery("delete from Galery").ExecuteUpdateAsync());
await (tx.CommitAsync());
}
}
}
}