-
Notifications
You must be signed in to change notification settings - Fork 923
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix support for nullable struct components (#3554)
- Loading branch information
Showing
6 changed files
with
109 additions
and
76 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
src/NHibernate.Test/Async/NHSpecificTest/NH1284/Fixture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
//------------------------------------------------------------------------------ | ||
// <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 NUnit.Framework; | ||
|
||
namespace NHibernate.Test.NHSpecificTest.NH1284 | ||
{ | ||
using System.Threading.Tasks; | ||
[TestFixture] | ||
public class FixtureAsync : BugTestCase | ||
{ | ||
protected override void OnTearDown() | ||
{ | ||
using var s = OpenSession(); | ||
using var tx = s.BeginTransaction(); | ||
s.Delete("from Person"); | ||
tx.Commit(); | ||
} | ||
|
||
[Test] | ||
public async Task EmptyValueTypeComponentAsync() | ||
{ | ||
Person jimmy; | ||
using (var s = OpenSession()) | ||
using (var tx = s.BeginTransaction()) | ||
{ | ||
var p = new Person("Jimmy Hendrix"); | ||
await (s.SaveAsync(p)); | ||
await (tx.CommitAsync()); | ||
} | ||
|
||
using (var s = OpenSession()) | ||
using (var tx = s.BeginTransaction()) | ||
{ | ||
jimmy = await (s.GetAsync<Person>("Jimmy Hendrix")); | ||
await (tx.CommitAsync()); | ||
} | ||
|
||
Assert.That(jimmy.Address, Is.Null); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ | |
<property name="GmtOffset"/> | ||
</component> | ||
</class> | ||
</hibernate-mapping> | ||
</hibernate-mapping> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters