Skip to content

Upgrade AsyncGenerator to 0.18.2 #2363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tools/packages.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CSharpAsyncGenerator.CommandLine" Version="0.18.1" />
<PackageReference Include="CSharpAsyncGenerator.CommandLine" Version="0.18.2" />
<PackageReference Include="vswhere" Version="2.1.4" />
<PackageReference Include="NUnit.Console" Version="3.10.0" />
<PackageReference Include="GitReleaseManager" Version="0.7.0" />
Expand Down
32 changes: 16 additions & 16 deletions src/NHibernate.Test/Async/Futures/FutureCriteriaFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,30 +64,30 @@ public async Task CanUseFutureCriteriaAsync()

[Test]
public async Task TwoFuturesRunInTwoRoundTripsAsync()
{
using (var s = Sfi.OpenSession())
{
IgnoreThisTestIfMultipleQueriesArentSupportedByDriver();

using (var logSpy = new SqlLogSpy())
{
var persons10 = s.CreateCriteria(typeof(Person))
{
using (var s = Sfi.OpenSession())
{
IgnoreThisTestIfMultipleQueriesArentSupportedByDriver();

using (var logSpy = new SqlLogSpy())
{
var persons10 = s.CreateCriteria(typeof(Person))
.SetMaxResults(10)
.Future<Person>();

foreach (var person in await (persons10.GetEnumerableAsync())) { } // fire first future round-trip
foreach (var person in await (persons10.GetEnumerableAsync())) { } // fire first future round-trip

var persons5 = s.CreateCriteria(typeof(Person))
var persons5 = s.CreateCriteria(typeof(Person))
.SetMaxResults(5)
.Future<int>();

foreach (var person in await (persons5.GetEnumerableAsync())) { } // fire second future round-trip
foreach (var person in await (persons5.GetEnumerableAsync())) { } // fire second future round-trip

var events = logSpy.Appender.GetEvents();
Assert.AreEqual(2, events.Length);
}
}
}
var events = logSpy.Appender.GetEvents();
Assert.AreEqual(2, events.Length);
}
}
}

[Test]
public async Task CanCombineSingleFutureValueWithEnumerableFuturesAsync()
Expand Down
30 changes: 15 additions & 15 deletions src/NHibernate.Test/Async/Linq/MiscellaneousTextFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public class MiscellaneousTextFixtureAsync : LinqTestCase
[Category("COUNT/SUM/MIN/MAX/AVG")]
[Test(Description = "This sample uses Count to find the number of Orders placed before yesterday in the database.")]
public async Task CountWithWhereClauseAsync()
{
var yesterday = DateTime.Today.AddDays(-1);
var q = from o in db.Orders where o.OrderDate <= yesterday select o;
{
var yesterday = DateTime.Today.AddDays(-1);
var q = from o in db.Orders where o.OrderDate <= yesterday select o;

var count = await (q.CountAsync());
var count = await (q.CountAsync());

Console.WriteLine(count);
}
Console.WriteLine(count);
}

[Category("From NHUser list")]
[Test(Description = "Telerik grid example, http://www.telerik.com/community/forums/aspnet-mvc/grid/grid-and-nhibernate-linq.aspx")]
Expand Down Expand Up @@ -137,17 +137,17 @@ orderby p.ProductId

[Test]
public async Task SelectFromObjectAsync()
{
using (var s = OpenSession())
{
var hql = await (s.CreateQuery("from System.Object o").ListAsync());
{
using (var s = OpenSession())
{
var hql = await (s.CreateQuery("from System.Object o").ListAsync());

var r = from o in s.Query<object>() select o;
var r = from o in s.Query<object>() select o;

var l = await (r.ToListAsync());
var l = await (r.ToListAsync());

Assert.AreEqual(hql.Count, l.Count);
}
}
Assert.AreEqual(hql.Count, l.Count);
}
}
}
}
16 changes: 8 additions & 8 deletions src/NHibernate.Test/Async/Linq/QueryLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,18 @@ orderby e.CompanyName
{
// TODO: We should try to verify that the exception actually IS a locking failure and not something unrelated.
Assert.ThrowsAsync<GenericADOException>(
async () =>
async () =>
{
var result2 = await ((
from e in s2.Query<Customer>()
where e.CustomerId == customerId
select e
).WithLock(LockMode.UpgradeNoWait)
.WithOptions(o => o.SetTimeout(5))
.ToListAsync(cancellationToken));
from e in s2.Query<Customer>()
where e.CustomerId == customerId
select e
).WithLock(LockMode.UpgradeNoWait)
.WithOptions(o => o.SetTimeout(5))
.ToListAsync(cancellationToken));
Assert.That(result2, Is.Not.Null);
},
"Expected an exception to indicate locking failure due to already locked.");
"Expected an exception to indicate locking failure due to already locked.");
}
return Task.CompletedTask;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Task IPostUpdateEventListener.OnPostUpdateAsync(PostUpdateEvent @event, Cancella
if (@event.Entity is Person)
{
return @event.Session
.CreateSQLQuery("update Person set Name = :newName")
.SetString("newName", "new updated name")
.ExecuteUpdateAsync(cancellationToken);
.CreateSQLQuery("update Person set Name = :newName")
.SetString("newName", "new updated name")
.ExecuteUpdateAsync(cancellationToken);
}
return Task.CompletedTask;
}
Expand Down
26 changes: 13 additions & 13 deletions src/NHibernate.Test/Async/NHSpecificTest/NH2500/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ protected override void OnTearDown()

[Test]
public async Task TestLinqProjectionExpressionDoesntCacheParametersAsync()
{
using (ISession session = Sfi.OpenSession())
using (ITransaction transaction = session.BeginTransaction())
{
this.count = 1;
using (ISession session = Sfi.OpenSession())
using (ITransaction transaction = session.BeginTransaction())
{
this.count = 1;

var foos1 = await (session.Query<Foo>()
var foos1 = await (session.Query<Foo>()
.Where(x => x.Name == "Banana")
.Select(x => new
{
Expand All @@ -77,9 +77,9 @@ public async Task TestLinqProjectionExpressionDoesntCacheParametersAsync()
User = "abc"
}).FirstAsync());

this.count = 2;
this.count = 2;

var foos2 = await (session.Query<Foo>()
var foos2 = await (session.Query<Foo>()
.Where(x => x.Name == "Egg")
.Select(x => new
{
Expand All @@ -88,13 +88,13 @@ public async Task TestLinqProjectionExpressionDoesntCacheParametersAsync()
User = "def"
}).FirstAsync());

Assert.AreEqual(1, foos1.count);
Assert.AreEqual(2, foos2.count);
Assert.AreEqual("abc", foos1.User);
Assert.AreEqual("def", foos2.User);
Assert.AreEqual(1, foos1.count);
Assert.AreEqual(2, foos2.count);
Assert.AreEqual("abc", foos1.User);
Assert.AreEqual("def", foos2.User);

await (transaction.CommitAsync());
await (transaction.CommitAsync());
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public override Task<object> GetAsync(object key, CancellationToken cancellation
return Task.FromResult<object>(null);

var fmt = new BinaryFormatter
{
{
#if !NETFX
SurrogateSelector = new SerializationHelper.SurrogateSelector()
SurrogateSelector = new SerializationHelper.SurrogateSelector()
#endif
};
};
using (var stream = new MemoryStream(entry))
{
return Task.FromResult<object>(fmt.Deserialize(stream));
Expand All @@ -53,11 +53,11 @@ public override Task PutAsync(object key, object value, CancellationToken cancel
try
{
var fmt = new BinaryFormatter
{
{
#if !NETFX
SurrogateSelector = new SerializationHelper.SurrogateSelector()
SurrogateSelector = new SerializationHelper.SurrogateSelector()
#endif
};
};
using (var stream = new MemoryStream())
{
fmt.Serialize(stream, value);
Expand Down
Loading