Skip to content

Commit f392694

Browse files
Fix test which may lack async generation.
1 parent 430a7e3 commit f392694

File tree

5 files changed

+74
-2
lines changed

5 files changed

+74
-2
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by AsyncGenerator.
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
11+
using System.Collections.Generic;
12+
using NHibernate.Dialect;
13+
using NHibernate.Type;
14+
using NUnit.Framework;
15+
using System;
16+
17+
namespace NHibernate.Test.TypesTest
18+
{
19+
using System.Threading.Tasks;
20+
21+
[TestFixture]
22+
public class DateTypeFixtureAsync : TypeFixtureBase
23+
{
24+
protected override string TypeName
25+
{
26+
get { return "Date"; }
27+
}
28+
29+
[Test]
30+
public async Task ReadWriteNormalAsync()
31+
{
32+
var expected = DateTime.Today.Date;
33+
34+
var basic = new DateClass { DateValue = expected.AddHours(1) };
35+
object savedId;
36+
using (ISession s = OpenSession())
37+
{
38+
savedId = await (s.SaveAsync(basic));
39+
await (s.FlushAsync());
40+
}
41+
using (ISession s = OpenSession())
42+
{
43+
basic = await (s.GetAsync<DateClass>(savedId));
44+
Assert.That(basic.DateValue, Is.EqualTo(expected));
45+
await (s.DeleteAsync(basic));
46+
await (s.FlushAsync());
47+
}
48+
}
49+
50+
[Test]
51+
public async Task ReadWriteBaseValueAsync()
52+
{
53+
var basic = new DateClass { DateValue = new DateTime(1899,1,1) };
54+
object savedId;
55+
using (ISession s = OpenSession())
56+
{
57+
savedId = await (s.SaveAsync(basic));
58+
await (s.FlushAsync());
59+
}
60+
using (ISession s = OpenSession())
61+
{
62+
basic = await (s.GetAsync<DateClass>(savedId));
63+
Assert.That(basic.DateValue.HasValue, Is.False);
64+
await (s.DeleteAsync(basic));
65+
await (s.FlushAsync());
66+
}
67+
}
68+
}
69+
}

src/NHibernate.Test/Async/TypesTest/PersistentEnumTypeFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,4 @@ public async Task CanWriteAndReadUsingBothHeuristicAndExplicitGenericDeclaration
9595
}
9696
}
9797
}
98-
}
98+
}

src/NHibernate.Test/TypesTest/DateTypeTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public void WhenSetParameterNullThenNotThrow()
3232
}
3333
}
3434

35+
[TestFixture]
3536
public class DateTypeFixture : TypeFixtureBase
3637
{
3738
protected override string TypeName

src/NHibernate.Test/TypesTest/PersistentEnumTypeFixture.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ public void CanWriteAndReadUsingBothHeuristicAndExplicitGenericDeclaration()
136136
}
137137
}
138138

139+
[TestFixture]
139140
public class GenericEnumTypeTest
140141
{
141142
[Test]
@@ -145,4 +146,4 @@ public void TheNameShouldBeFullNameAndAssembly()
145146
Assert.That(enumType.Name, Is.EqualTo(typeof(EnumType<B>).FullName + ", NHibernate"));
146147
}
147148
}
148-
}
149+
}

src/NHibernate.Test/TypesTest/TypeSqlTypeFixture.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class MultiTypeEntity
1919
public virtual string StringClob { get; set; }
2020
}
2121

22+
[TestFixture]
2223
public abstract class TypeSqlTypeFixture
2324
{
2425
protected const string TestNameSpace = "NHibernate.Test.TypesTest.";

0 commit comments

Comments
 (0)