Skip to content

Commit

Permalink
Split simple partial test classes
Browse files Browse the repository at this point in the history
Closes #18786
  • Loading branch information
roji committed Nov 15, 2019
1 parent 403d7b7 commit d101082
Show file tree
Hide file tree
Showing 33 changed files with 1,583 additions and 1,077 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,24 @@

using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Diagnostics.Internal;
using Microsoft.EntityFrameworkCore.TestModels.Northwind;
using Microsoft.EntityFrameworkCore.TestUtilities;
using Xunit;
using Xunit.Abstractions;

namespace Microsoft.EntityFrameworkCore.Query
{
public partial class SimpleQueryCosmosTest
public class NorthwindAggregateOperatorsQueryCosmosTest : NorthwindAggregateOperatorsQueryTestBase<NorthwindQueryCosmosFixture<NoopModelCustomizer>>
{
public NorthwindAggregateOperatorsQueryCosmosTest(
NorthwindQueryCosmosFixture<NoopModelCustomizer> fixture,
ITestOutputHelper testOutputHelper)
: base(fixture)
{
ClearLog();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact(Skip = "Issue#17246")]
public override void Select_All()
{
Expand Down Expand Up @@ -51,6 +60,18 @@ FROM root c
WHERE (c[""Discriminator""] = ""Order"")");
}

[ConditionalTheory(Skip = "Issue #17246")]
public override Task Sum_with_no_arg_empty(bool async)
{
return base.Sum_with_no_arg_empty(async);
}

[ConditionalTheory(Skip = "Issue #17246")]
public override Task Sum_with_no_data_nullable(bool async)
{
return base.Sum_with_no_data_nullable(async);
}

[ConditionalTheory(Skip = "Issue#16146")]
public override async Task Sum_with_arg(bool async)
{
Expand Down Expand Up @@ -559,6 +580,12 @@ FROM root c
WHERE ((c[""Discriminator""] = ""Customer"") AND (c[""CustomerID""] = ""CENTC""))");
}

[ConditionalTheory(Skip = "Issue #17246")]
public override Task Count_with_no_predicate(bool async)
{
return base.Count_with_no_predicate(async);
}

[ConditionalTheory(Skip = "Issue#16146")]
public override async Task Count_with_predicate(bool async)
{
Expand All @@ -570,6 +597,12 @@ FROM root c
WHERE ((c[""Discriminator""] = ""Order"") AND (c[""CustomerID""] = ""ALFKI""))");
}

[ConditionalTheory(Skip = "Issue #17246")]
public override Task Count_with_order_by(bool async)
{
return base.Count_with_order_by(async);
}

[ConditionalTheory(Skip = "Issue#16146")]
public override async Task Where_OrderBy_Count(bool async)
{
Expand Down Expand Up @@ -823,6 +856,12 @@ FROM root c
WHERE (c[""Discriminator""] = ""Customer"")");
}

[ConditionalTheory(Skip = "Issue #17246")]
public override Task Multiple_collection_navigation_with_FirstOrDefault_chained_projecting_scalar(bool async)
{
return base.Multiple_collection_navigation_with_FirstOrDefault_chained_projecting_scalar(async);
}

[ConditionalTheory(Skip = "Issue#17246")]
public override async Task First_inside_subquery_gets_client_evaluated(bool async)
{
Expand Down Expand Up @@ -1464,6 +1503,24 @@ FROM root c
WHERE (c[""Discriminator""] = ""Customer"")");
}

[ConditionalTheory(Skip = "Issue #17246")]
public override Task Cast_before_aggregate_is_preserved(bool async)
{
return base.Cast_before_aggregate_is_preserved(async);
}

[ConditionalTheory(Skip = "Issue #17246")]
public override Task Enumerable_min_is_mapped_to_Queryable_1(bool async)
{
return base.Enumerable_min_is_mapped_to_Queryable_1(async);
}

[ConditionalTheory(Skip = "Issue #17246")]
public override Task Enumerable_min_is_mapped_to_Queryable_2(bool async)
{
return base.Enumerable_min_is_mapped_to_Queryable_2(async);
}

[ConditionalTheory(Skip = "Issue#17246")]
public override Task DefaultIfEmpty_selects_only_required_columns(bool async)
{
Expand All @@ -1487,5 +1544,11 @@ public override Task Sum_over_explicit_cast_over_column(bool async)
{
return base.Sum_over_explicit_cast_over_column(async);
}

private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);

protected override void ClearLog()
=> Fixture.TestSqlLoggerFactory.Clear();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.TestUtilities;
using Xunit;
using Xunit.Abstractions;

namespace Microsoft.EntityFrameworkCore.Query
{
public partial class SimpleQueryCosmosTest
public class NorthwindFunctionsQueryCosmosTest : NorthwindFunctionsQueryTestBase<NorthwindQueryCosmosFixture<NoopModelCustomizer>>
{
public NorthwindFunctionsQueryCosmosTest(
NorthwindQueryCosmosFixture<NoopModelCustomizer> fixture,
ITestOutputHelper testOutputHelper)
: base(fixture)
{
ClearLog();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalTheory(Skip = "Issue #17246")]
public override async Task String_StartsWith_Literal(bool async)
{
Expand Down Expand Up @@ -779,6 +790,12 @@ FROM root c
WHERE (c[""Discriminator""] = ""Customer"")");
}

[ConditionalTheory(Skip = "Issue #17246")]
public override Task IsNullOrWhiteSpace_in_predicate_on_non_nullable_column(bool async)
{
return base.IsNullOrWhiteSpace_in_predicate_on_non_nullable_column(async);
}

public override void IsNullOrEmpty_in_projection()
{
base.IsNullOrEmpty_in_projection();
Expand Down Expand Up @@ -1013,5 +1030,11 @@ public override Task Int_Compare_to_simple_zero(bool async)
{
return base.Int_Compare_to_simple_zero(async);
}

private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);

protected override void ClearLog()
=> Fixture.TestSqlLoggerFactory.Clear();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,23 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.TestModels.Northwind;
using Microsoft.EntityFrameworkCore.TestUtilities;
using Xunit;
using Xunit.Abstractions;

namespace Microsoft.EntityFrameworkCore.Query
{
public partial class SimpleQueryCosmosTest
public class NorthwindJoinGroupJoinQueryCosmosTest : NorthwindJoinGroupJoinQueryTestBase<NorthwindQueryCosmosFixture<NoopModelCustomizer>>
{
public NorthwindJoinGroupJoinQueryCosmosTest(
NorthwindQueryCosmosFixture<NoopModelCustomizer> fixture,
ITestOutputHelper testOutputHelper)
: base(fixture)
{
ClearLog();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalTheory(Skip = "Issue#17246")]
public override async Task Join_customers_orders_projection(bool async)
{
Expand All @@ -32,6 +43,12 @@ FROM root c
WHERE (c[""Discriminator""] = ""Customer"")");
}

[ConditionalTheory(Skip = "Issue #17246")]
public override Task Join_customers_orders_entities_same_entity_twice(bool async)
{
return base.Join_customers_orders_entities_same_entity_twice(async);
}

[ConditionalTheory(Skip = "Issue#17246")]
public override async Task Join_select_many(bool async)
{
Expand Down Expand Up @@ -259,6 +276,30 @@ FROM root c
WHERE ((c[""Discriminator""] = ""Customer"") AND ((c[""CustomerID""] != ""VAFFE"") AND (c[""CustomerID""] != ""DRACD"")))");
}

[ConditionalTheory(Skip = "Issue#17246")]
public override Task GroupJoin_customers_employees_shadow(bool async)
{
return base.GroupJoin_customers_employees_shadow(async);
}

[ConditionalTheory(Skip = "Issue#17246")]
public override Task GroupJoin_customers_employees_subquery_shadow(bool async)
{
return base.GroupJoin_customers_employees_subquery_shadow(async);
}

[ConditionalTheory(Skip = "Issue#17246")]
public override Task GroupJoin_customers_employees_subquery_shadow_take(bool async)
{
return base.GroupJoin_customers_employees_subquery_shadow_take(async);
}

[ConditionalTheory(Skip = "Issue#17246")]
public override Task GroupJoin_projection(bool async)
{
return base.GroupJoin_projection(async);
}

[ConditionalTheory(Skip = "Issue#17246")]
public override async Task GroupJoin_simple(bool async)
{
Expand Down Expand Up @@ -632,5 +673,11 @@ public override Task GroupJoin_Subquery_with_Take_Then_SelectMany_Where(bool asy
{
return base.GroupJoin_Subquery_with_Take_Then_SelectMany_Where(async);
}

private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);

protected override void ClearLog()
=> Fixture.TestSqlLoggerFactory.Clear();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,23 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.TestModels.Northwind;
using Microsoft.EntityFrameworkCore.TestUtilities;
using Xunit;
using Xunit.Abstractions;

namespace Microsoft.EntityFrameworkCore.Query
{
public partial class SimpleQueryCosmosTest
public class NorthwindKeylessEntitiesQueryCosmosTest : NorthwindKeylessEntitiesQueryTestBase<NorthwindQueryCosmosFixture<NoopModelCustomizer>>
{
public NorthwindKeylessEntitiesQueryCosmosTest(
NorthwindQueryCosmosFixture<NoopModelCustomizer> fixture,
ITestOutputHelper testOutputHelper)
: base(fixture)
{
ClearLog();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalTheory]
public override async Task KeylessEntity_simple(bool async)
{
Expand Down Expand Up @@ -43,6 +54,12 @@ FROM root c
WHERE ((c[""Discriminator""] = ""Product"") AND NOT(c[""Discontinued""]))");
}

[ConditionalFact(Skip = "See issue#13857")]
public override void Auto_initialized_view_set()
{
base.Auto_initialized_view_set();
}

[ConditionalFact(Skip = "issue #12086")] // collection support
public override void KeylessEntity_with_nav_defining_query()
{
Expand Down Expand Up @@ -121,5 +138,11 @@ public override async Task KeylesEntity_groupby(bool async)

AssertSql(@"");
}

private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);

protected override void ClearLog()
=> Fixture.TestSqlLoggerFactory.Clear();
}
}
Loading

0 comments on commit d101082

Please sign in to comment.