|
| 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; |
| 12 | +using System.Linq; |
| 13 | +using NUnit.Framework; |
| 14 | +using NHibernate.Linq; |
| 15 | + |
| 16 | +namespace NHibernate.Test.NHSpecificTest.GH1313 |
| 17 | +{ |
| 18 | + using System.Threading.Tasks; |
| 19 | + [TestFixture] |
| 20 | + public class FixtureAsync : BugTestCase |
| 21 | + { |
| 22 | + protected override void OnSetUp() |
| 23 | + { |
| 24 | + using var session = OpenSession(); |
| 25 | + using var transaction = session.BeginTransaction(); |
| 26 | + |
| 27 | + var account = new Account { Id = 1, Name = "Account_1", OldAccountNumber = 1 }; |
| 28 | + var order = new HoldClose |
| 29 | + { |
| 30 | + Account = account, |
| 31 | + CloseDate = new DateTime(2023, 1, 1) |
| 32 | + }; |
| 33 | + |
| 34 | + session.Save(account); |
| 35 | + session.Save(order); |
| 36 | + transaction.Commit(); |
| 37 | + } |
| 38 | + |
| 39 | + protected override void OnTearDown() |
| 40 | + { |
| 41 | + using var session = OpenSession(); |
| 42 | + using var transaction = session.BeginTransaction(); |
| 43 | + |
| 44 | + session.CreateQuery("delete from System.Object").ExecuteUpdate(); |
| 45 | + transaction.Commit(); |
| 46 | + } |
| 47 | + |
| 48 | + [Test] |
| 49 | + [Explicit("Not fixed yet")] |
| 50 | + public async Task ManyToOneTargettingAFormulaAsync() |
| 51 | + { |
| 52 | + using var session = OpenSession(); |
| 53 | + using var transaction = session.BeginTransaction(); |
| 54 | + |
| 55 | + var result = session.Query<HoldClose>(); |
| 56 | + |
| 57 | + Assert.That(await (result.ToListAsync()), Has.Count.EqualTo(1)); |
| 58 | + await (transaction.CommitAsync()); |
| 59 | + } |
| 60 | + } |
| 61 | +} |
0 commit comments