Skip to content

Commit

Permalink
'Take_with_single_select_many' test no longer misbehaves on .NET Core…
Browse files Browse the repository at this point in the history
… 2.0
  • Loading branch information
azabluda committed Aug 24, 2017
1 parent 739f876 commit 56c0548
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 68 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
namespace InfoCarrier.Core.FunctionalTests.InMemory
{
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.TestModels.Northwind;
using Xunit;

public class AsyncQueryInfoCarrierTest : AsyncQueryTestBase<NorthwindQueryInfoCarrierFixture>
Expand All @@ -26,35 +22,5 @@ public override Task Mixed_sync_async_query()
{
return base.Mixed_sync_async_query();
}

[Fact]
public override async Task Take_with_single_select_many()
{
// UGLY: this is a complete copy-n-paste of the original test.
// Workarounds an unexplainable failure when running the test with netcoreapp1.0.
await AssertQuery<Customer, Order>((cs, os) =>
(from c in cs
from o in os
orderby c.CustomerID, o.OrderID
select new { c, o })
.Take(1)
.Cast<object>()
.SingleAsync());

async Task AssertQuery<TItem1, TItem2>(
Func<IQueryable<TItem1>, IQueryable<TItem2>, Task<object>> query,
bool assertOrder = false)
where TItem1 : class
where TItem2 : class
{
using (var context = this.CreateContext())
{
TestHelpers.AssertResults(
new[] { await query(NorthwindData.Set<TItem1>(), NorthwindData.Set<TItem2>()) },
new[] { await query(context.Set<TItem1>(), context.Set<TItem2>()) },
assertOrder);
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
namespace InfoCarrier.Core.FunctionalTests.InMemory
{
using System;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.TestModels.Northwind;
using Xunit;

public class QueryInfoCarrierTest : QueryTestBase<NorthwindQueryInfoCarrierFixture>
Expand Down Expand Up @@ -32,36 +28,6 @@ public override void Client_Join_select_many()
base.Client_Join_select_many();
}

[Fact]
public override void Take_with_single_select_many()
{
// UGLY: this is a complete copy-n-paste of the original test.
// Workarounds an unexplainable failure when running the test with netcoreapp1.0.
AssertQuery<Customer, Order>((cs, os) =>
(from c in cs
from o in os
orderby c.CustomerID, o.OrderID
select new { c, o })
.Take(1)
.Cast<object>()
.Single());

void AssertQuery<TItem1, TItem2>(
Func<IQueryable<TItem1>, IQueryable<TItem2>, object> query,
bool assertOrder = false)
where TItem1 : class
where TItem2 : class
{
using (var context = this.CreateContext())
{
TestHelpers.AssertResults(
new[] { query(NorthwindData.Set<TItem1>(), NorthwindData.Set<TItem2>()) },
new[] { query(context.Set<TItem1>(), context.Set<TItem2>()) },
assertOrder);
}
}
}

[Fact(Skip = "Revisit after https://github.com/aspnet/EntityFrameworkCore/issues/9301")]
public override void GroupJoin_outer_projection2()
{
Expand Down

0 comments on commit 56c0548

Please sign in to comment.