CosmosDb: Add assembly attribute to skip tests when emulator is not running
Add CosmosDb src/test projects as part of build script
This commit is contained in:
Родитель
662adf9a0f
Коммит
26985ffa91
|
@ -140,10 +140,6 @@ dotnet_naming_style.camel_case_style.capitalization = camel_case
|
|||
dotnet_naming_style.interface_style.capitalization = pascal_case
|
||||
dotnet_naming_style.interface_style.required_prefix = I
|
||||
|
||||
# PascalCase with T prefix
|
||||
dotnet_naming_style.type_parameter_style.capitalization = pascal_case
|
||||
dotnet_naming_style.type_parameter_style.required_prefix = T
|
||||
|
||||
# camelCase with _ prefix
|
||||
dotnet_naming_style._camelCase.capitalization = camel_case
|
||||
dotnet_naming_style._camelCase.required_prefix = _
|
||||
|
@ -164,13 +160,6 @@ dotnet_naming_rule.class_naming.severity = warning
|
|||
dotnet_naming_symbols.class_symbol.applicable_kinds = class, struct, enum, property, method, event, namespace
|
||||
dotnet_naming_symbols.class_symbol.applicable_accessibilities = *
|
||||
|
||||
# Type Parameters
|
||||
dotnet_naming_rule.type_parameter_naming.symbols = type_parameter_symbol
|
||||
dotnet_naming_rule.type_parameter_naming.style = type_parameter_style
|
||||
dotnet_naming_rule.type_parameter_naming.severity = warning
|
||||
dotnet_naming_symbols.type_parameter_symbol.applicable_kinds = type_parameter
|
||||
dotnet_naming_symbols.type_parameter_symbol.applicable_accessibilities = *
|
||||
|
||||
# Const fields
|
||||
dotnet_naming_rule.const_field_naming.symbols = const_field_symbol
|
||||
dotnet_naming_rule.const_field_naming.style = pascal_case_style
|
||||
|
|
|
@ -5,13 +5,13 @@ VisualStudioVersion = 15.0.27713.0
|
|||
MinimumVisualStudioVersion = 15.0.26730.03
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{712F6813-A5CD-40D4-836F-F9667A3AE762}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Cosmos.Sql", "src\EFCore.Cosmos.Sql\EFCore.Cosmos.Sql.csproj", "{7F8D0738-412A-4B8E-B405-E91DDF433050}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Cosmos.Sql", "src\EFCore.Cosmos.Sql\EFCore.Cosmos.Sql.csproj", "{6C115EF9-519E-4A4E-BD02-3801777BFEBA}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{02887729-B5B3-455D-B4E8-1483872A6666}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Cosmos.Sql.FunctionalTests", "test\EFCore.Cosmos.Sql.FunctionalTests\EFCore.Cosmos.Sql.FunctionalTests.csproj", "{8C66AB84-F93A-423D-8D4C-68572F7AD501}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Cosmos.Sql.FunctionalTests", "test\EFCore.Cosmos.Sql.FunctionalTests\EFCore.Cosmos.Sql.FunctionalTests.csproj", "{76EB1FAD-00F9-4B92-B954-073AF288D3DD}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Cosmos.Sql.Tests", "test\EFCore.Cosmos.Sql.Tests\EFCore.Cosmos.Sql.Tests.csproj", "{13512CDE-B6FB-4C9D-896A-44DD2D69E2FF}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Cosmos.Sql.Tests", "test\EFCore.Cosmos.Sql.Tests\EFCore.Cosmos.Sql.Tests.csproj", "{B4E155E5-C0B8-4680-92A0-A0DE745486B1}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore", "src\EFCore\EFCore.csproj", "{73C3A822-F3A9-4AFC-A49F-2C97CE05D504}"
|
||||
EndProject
|
||||
|
@ -35,18 +35,18 @@ Global
|
|||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7F8D0738-412A-4B8E-B405-E91DDF433050}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7F8D0738-412A-4B8E-B405-E91DDF433050}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7F8D0738-412A-4B8E-B405-E91DDF433050}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7F8D0738-412A-4B8E-B405-E91DDF433050}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8C66AB84-F93A-423D-8D4C-68572F7AD501}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8C66AB84-F93A-423D-8D4C-68572F7AD501}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8C66AB84-F93A-423D-8D4C-68572F7AD501}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8C66AB84-F93A-423D-8D4C-68572F7AD501}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{13512CDE-B6FB-4C9D-896A-44DD2D69E2FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{13512CDE-B6FB-4C9D-896A-44DD2D69E2FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{13512CDE-B6FB-4C9D-896A-44DD2D69E2FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{13512CDE-B6FB-4C9D-896A-44DD2D69E2FF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6C115EF9-519E-4A4E-BD02-3801777BFEBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6C115EF9-519E-4A4E-BD02-3801777BFEBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6C115EF9-519E-4A4E-BD02-3801777BFEBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6C115EF9-519E-4A4E-BD02-3801777BFEBA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{76EB1FAD-00F9-4B92-B954-073AF288D3DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{76EB1FAD-00F9-4B92-B954-073AF288D3DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{76EB1FAD-00F9-4B92-B954-073AF288D3DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{76EB1FAD-00F9-4B92-B954-073AF288D3DD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B4E155E5-C0B8-4680-92A0-A0DE745486B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B4E155E5-C0B8-4680-92A0-A0DE745486B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B4E155E5-C0B8-4680-92A0-A0DE745486B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B4E155E5-C0B8-4680-92A0-A0DE745486B1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{73C3A822-F3A9-4AFC-A49F-2C97CE05D504}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{73C3A822-F3A9-4AFC-A49F-2C97CE05D504}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{73C3A822-F3A9-4AFC-A49F-2C97CE05D504}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
@ -84,9 +84,9 @@ Global
|
|||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{7F8D0738-412A-4B8E-B405-E91DDF433050} = {712F6813-A5CD-40D4-836F-F9667A3AE762}
|
||||
{8C66AB84-F93A-423D-8D4C-68572F7AD501} = {02887729-B5B3-455D-B4E8-1483872A6666}
|
||||
{13512CDE-B6FB-4C9D-896A-44DD2D69E2FF} = {02887729-B5B3-455D-B4E8-1483872A6666}
|
||||
{6C115EF9-519E-4A4E-BD02-3801777BFEBA} = {712F6813-A5CD-40D4-836F-F9667A3AE762}
|
||||
{76EB1FAD-00F9-4B92-B954-073AF288D3DD} = {02887729-B5B3-455D-B4E8-1483872A6666}
|
||||
{B4E155E5-C0B8-4680-92A0-A0DE745486B1} = {02887729-B5B3-455D-B4E8-1483872A6666}
|
||||
{73C3A822-F3A9-4AFC-A49F-2C97CE05D504} = {712F6813-A5CD-40D4-836F-F9667A3AE762}
|
||||
{3448537C-08B3-4860-A128-3C0FD561C11C} = {712F6813-A5CD-40D4-836F-F9667A3AE762}
|
||||
{11D34E4A-1E58-4C7D-BBF5-52388592CD9F} = {712F6813-A5CD-40D4-836F-F9667A3AE762}
|
||||
|
|
21
EFCore.sln
21
EFCore.sln
|
@ -91,6 +91,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Analyzers", "src\EFC
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Analyzers.Test", "test\EFCore.Analyzers.Tests\EFCore.Analyzers.Test.csproj", "{7BC66E5C-BAA3-420B-8331-22821EBA361A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Cosmos.Sql", "src\EFCore.Cosmos.Sql\EFCore.Cosmos.Sql.csproj", "{6C115EF9-519E-4A4E-BD02-3801777BFEBA}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Cosmos.Sql.FunctionalTests", "test\EFCore.Cosmos.Sql.FunctionalTests\EFCore.Cosmos.Sql.FunctionalTests.csproj", "{76EB1FAD-00F9-4B92-B954-073AF288D3DD}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Cosmos.Sql.Tests", "test\EFCore.Cosmos.Sql.Tests\EFCore.Cosmos.Sql.Tests.csproj", "{B4E155E5-C0B8-4680-92A0-A0DE745486B1}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -221,6 +227,18 @@ Global
|
|||
{7BC66E5C-BAA3-420B-8331-22821EBA361A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7BC66E5C-BAA3-420B-8331-22821EBA361A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7BC66E5C-BAA3-420B-8331-22821EBA361A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6C115EF9-519E-4A4E-BD02-3801777BFEBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6C115EF9-519E-4A4E-BD02-3801777BFEBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6C115EF9-519E-4A4E-BD02-3801777BFEBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6C115EF9-519E-4A4E-BD02-3801777BFEBA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{76EB1FAD-00F9-4B92-B954-073AF288D3DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{76EB1FAD-00F9-4B92-B954-073AF288D3DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{76EB1FAD-00F9-4B92-B954-073AF288D3DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{76EB1FAD-00F9-4B92-B954-073AF288D3DD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B4E155E5-C0B8-4680-92A0-A0DE745486B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B4E155E5-C0B8-4680-92A0-A0DE745486B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B4E155E5-C0B8-4680-92A0-A0DE745486B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B4E155E5-C0B8-4680-92A0-A0DE745486B1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -260,6 +278,9 @@ Global
|
|||
{313F46FE-9962-4A15-805F-FCBDF5A6181E} = {258D5057-81B9-40EC-A872-D21E27452749}
|
||||
{C0D4A199-3ED4-447B-8657-0502493294E7} = {CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC}
|
||||
{7BC66E5C-BAA3-420B-8331-22821EBA361A} = {258D5057-81B9-40EC-A872-D21E27452749}
|
||||
{6C115EF9-519E-4A4E-BD02-3801777BFEBA} = {CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC}
|
||||
{76EB1FAD-00F9-4B92-B954-073AF288D3DD} = {258D5057-81B9-40EC-A872-D21E27452749}
|
||||
{B4E155E5-C0B8-4680-92A0-A0DE745486B1} = {258D5057-81B9-40EC-A872-D21E27452749}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {285A5EB4-BCF4-40EB-B9E1-DF6DBCB5E705}
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
<DotNetCoreRuntime Include="$(MicrosoftNETCoreApp22PackageVersion)" />
|
||||
|
||||
<ExcludeFromTest Include="$(RepositoryRoot)samples\OracleProvider\test\OracleProvider.FunctionalTests\*.csproj" />
|
||||
<ExcludeFromPack Include="$(RepositoryRoot)src\EFCore.Cosmos.Sql\*.csproj" />
|
||||
<ExcludeFromTest Include="$(RepositoryRoot)test\EFCore.Cosmos.Sql.FunctionalTests\*.csproj" />
|
||||
<ExcludeFromTest Include="$(RepositoryRoot)test\EFCore.Cosmos.Sql.Tests\*.csproj" />
|
||||
<ExcludeSolutions Include="$(RepositoryRoot)EFCore.Runtime.sln" />
|
||||
<ExcludeSolutions Include="$(RepositoryRoot)EFCore.Cosmos.sln" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
dotnet build EFCore.Cosmos.sln && (
|
||||
dotnet test .\test\EFCore.Cosmos.Sql.FunctionalTests\ --no-build) && (
|
||||
dotnet test .\test\EFCore.Cosmos.Sql.Tests\ --no-build)
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<Description>Cosmos SQL API provider for Entity Framework Core.</Description>
|
||||
<PackageVersion>0.1.0-preview1</PackageVersion>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<MinClientVersion>3.6</MinClientVersion>
|
||||
<AssemblyName>Microsoft.EntityFrameworkCore.Cosmos.Sql</AssemblyName>
|
||||
|
|
|
@ -5,6 +5,7 @@ using System.Linq;
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore.Cosmos.Sql.TestUtilities;
|
||||
using Microsoft.EntityFrameworkCore.TestUtilities;
|
||||
using Microsoft.EntityFrameworkCore.TestUtilities.Xunit;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.EntityFrameworkCore.Cosmos.Sql
|
||||
|
@ -20,7 +21,7 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Sql
|
|||
Fixture = fixture;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[ConditionalFact]
|
||||
// TODO: Remove ToList when Single/Count works
|
||||
public async Task Can_add_update_delete_end_to_end()
|
||||
{
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.EntityFrameworkCore.Cosmos.Sql.TestUtilities;
|
||||
using Xunit;
|
||||
|
||||
// Skip the entire assembly if cannot connect to CosmosDb
|
||||
[assembly: TestFramework("Microsoft.EntityFrameworkCore.TestUtilities.Xunit.ConditionalTestFramework", "Microsoft.EntityFrameworkCore.Specification.Tests")]
|
||||
[assembly: CosmosDbConfiguredCondition]
|
|
@ -12,7 +12,7 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Sql.Query
|
|||
{
|
||||
public partial class SimpleQueryCosmosSqlTest : QueryTestBase<NorthwindQueryCosmosSqlFixture<NoopModelCustomizer>>
|
||||
{
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_add(bool isAsync)
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Order"") AND ((c[""OrderID""] + 10) = 10258))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_subtract(bool isAsync)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Order"") AND ((c[""OrderID""] - 10) = 10238))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_multiply(bool isAsync)
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Order"") AND ((c[""OrderID""] * 1) = 10248))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_divide(bool isAsync)
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Order"") AND ((c[""OrderID""] / 1) = 10248))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_modulo(bool isAsync)
|
||||
{
|
||||
|
@ -87,7 +87,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Order"") AND ((c[""OrderID""] % 10248) = 0))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_bitwise_or(bool isAsync)
|
||||
{
|
||||
|
@ -102,7 +102,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Order"") AND ((c[""OrderID""] | 10248) = 10248))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_bitwise_and(bool isAsync)
|
||||
{
|
||||
|
@ -117,7 +117,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Order"") AND ((c[""OrderID""] & 11067) = 11067))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_bitwise_xor(bool isAsync)
|
||||
{
|
||||
|
@ -132,7 +132,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Order"") AND ((c[""OrderID""] ^ 10248) = 0))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_bitwise_leftshift(bool isAsync)
|
||||
{
|
||||
|
@ -147,7 +147,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Order"") AND ((c[""OrderID""] << 1) = 20496))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_bitwise_rightshift(bool isAsync)
|
||||
{
|
||||
|
@ -162,7 +162,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Order"") AND ((c[""OrderID""] >> 1) = 5124))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_logical_and(bool isAsync)
|
||||
{
|
||||
|
@ -177,7 +177,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Customer"") AND ((c[""City""] = ""Seattle"") AND (c[""ContactTitle""] = ""Owner"")))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_logical_or(bool isAsync)
|
||||
{
|
||||
|
@ -192,7 +192,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Customer"") AND ((c[""CustomerID""] = ""ALFKI"") OR (c[""CustomerID""] = ""ANATR"")))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_logical_not(bool isAsync)
|
||||
{
|
||||
|
@ -207,7 +207,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Customer"") AND NOT((c[""City""] != ""Seattle"")))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_equality(bool isAsync)
|
||||
{
|
||||
|
@ -222,7 +222,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Employee"") AND (c[""ReportsTo""] = 2))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_inequality(bool isAsync)
|
||||
{
|
||||
|
@ -237,7 +237,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Employee"") AND (c[""ReportsTo""] != 2))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_greaterthan(bool isAsync)
|
||||
{
|
||||
|
@ -252,7 +252,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Employee"") AND (c[""ReportsTo""] > 2))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_greaterthanorequal(bool isAsync)
|
||||
{
|
||||
|
@ -267,7 +267,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Employee"") AND (c[""ReportsTo""] >= 2))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_lessthan(bool isAsync)
|
||||
{
|
||||
|
@ -282,7 +282,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Employee"") AND (c[""ReportsTo""] < 2))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_lessthanorequal(bool isAsync)
|
||||
{
|
||||
|
@ -297,7 +297,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Employee"") AND (c[""ReportsTo""] <= 2))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_string_concat(bool isAsync)
|
||||
{
|
||||
|
@ -312,7 +312,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Customer"") AND ((c[""CustomerID""] || ""END"") = ""ALFKIEND""))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_unary_minus(bool isAsync)
|
||||
{
|
||||
|
@ -327,7 +327,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Order"") AND (-(c[""OrderID""]) = -10248))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_bitwise_not(bool isAsync)
|
||||
{
|
||||
|
@ -342,7 +342,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Order"") AND (~(c[""OrderID""]) = -10249))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_ternary(bool isAsync)
|
||||
{
|
||||
|
@ -359,7 +359,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Customer"") AND (((c[""Region""] != null) ? c[""Region""] : ""SP"") = ""BC""))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_coalesce(bool isAsync)
|
||||
{
|
||||
|
@ -374,7 +374,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Customer"") AND ((c[""Region""] ?? ""SP"") = ""BC""))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_simple_closure(bool isAsync)
|
||||
{
|
||||
|
@ -393,7 +393,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Customer"") AND (c[""City""] = @__city_0))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_simple_closure_nullable_type(bool isAsync)
|
||||
{
|
||||
|
@ -438,7 +438,7 @@ FROM root c
|
|||
WHERE ((c[""Discriminator""] = ""Employee"") AND (c[""ReportsTo""] = @__reportsTo_0))");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Where_simple_shadow(bool isAsync)
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
using Microsoft.EntityFrameworkCore.Query;
|
||||
using Microsoft.EntityFrameworkCore.TestModels.Northwind;
|
||||
using Microsoft.EntityFrameworkCore.TestUtilities;
|
||||
using Microsoft.EntityFrameworkCore.TestUtilities.Xunit;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
|
@ -21,7 +22,7 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.Sql.Query
|
|||
|
||||
protected NorthwindContext CreateContext() => Fixture.CreateContext();
|
||||
|
||||
[Theory]
|
||||
[ConditionalTheory]
|
||||
[InlineData(false)]
|
||||
public virtual void Simple_IQuaryable(bool isAsync)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Net;
|
||||
using Microsoft.Azure.Documents.Client;
|
||||
using Microsoft.EntityFrameworkCore.TestUtilities.Xunit;
|
||||
|
||||
namespace Microsoft.EntityFrameworkCore.Cosmos.Sql.TestUtilities
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)]
|
||||
public class CosmosDbConfiguredConditionAttribute : Attribute, ITestCondition
|
||||
{
|
||||
private static readonly bool _connectionAvailable = Connect();
|
||||
|
||||
public string SkipReason => "Unable to connect to CosmosDb Emulator. Please install/start emulator service.";
|
||||
|
||||
public bool IsMet => _connectionAvailable;
|
||||
|
||||
private static bool Connect()
|
||||
{
|
||||
var documentClient = new DocumentClient(
|
||||
new Uri(TestEnvironment.DefaultConnection),
|
||||
TestEnvironment.AuthToken);
|
||||
|
||||
try
|
||||
{
|
||||
documentClient.OpenAsync().GetAwaiter().GetResult();
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
documentClient.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче