Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion benchmark/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="xunit.assert" VersionOverride="$(XUnitVersion)" />
<PackageReference Include="xunit.v3.assert" VersionOverride="$(XUnitV3Version)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" />
</ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
<OpenTelemetryExporterInMemoryVersion>1.15.1</OpenTelemetryExporterInMemoryVersion>
<SQLitePCLRawVersion>3.0.3</SQLitePCLRawVersion>
<SQLite3MCPCLRawBundleVersion>2.3.2</SQLite3MCPCLRawBundleVersion>
<MicrosoftDotNetXUnitV3ExtensionsVersion>11.0.0-beta.26263.112</MicrosoftDotNetXUnitV3ExtensionsVersion>
<MicrosoftTestingPlatformVersion>2.2.2</MicrosoftTestingPlatformVersion>
</PropertyGroup>

<PropertyGroup Label="Analyzers">
Expand Down
6 changes: 5 additions & 1 deletion test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<NoWarn>$(NoWarn);CA1707;1591;xUnit1000;xUnit1003;xUnit1004;xUnit1010;xUnit1013;xUnit1026;xUnit2013;xUnit1024</NoWarn>
<NoWarn>$(NoWarn);CA1707;1591;xUnit1000;xUnit1003;xUnit1004;xUnit1010;xUnit1013;xUnit1026;xUnit2013;xUnit1024;xUnit1051;xUnit1031</NoWarn>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)..\rulesets\EFCore.test.ruleset</CodeAnalysisRuleSet>
<LangVersion>preview</LangVersion>
<NuGetAudit>false</NuGetAudit>
</PropertyGroup>

<PropertyGroup Condition="'$(IsUnitTestProject)' == 'true'">
<TestRunnerName>XUnitV3</TestRunnerName>
</PropertyGroup>

</Project>
3 changes: 3 additions & 0 deletions test/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
<PackageVersion Include="SQLitePCLRaw.provider.sqlite3" Version="$(SQLitePCLRawVersion)" />
<PackageVersion Include="SQLitePCLRaw.provider.winsqlite3" Version="$(SQLitePCLRawVersion)" />
<PackageVersion Include="Testcontainers.CosmosDb" Version="4.11.0" />
<PackageVersion Include="Microsoft.DotNet.XUnitV3Extensions" Version="$(MicrosoftDotNetXUnitV3ExtensionsVersion)" />
<PackageVersion Include="xunit.v3.assert.aot" Version="$(XUnitV3Version)" />
<PackageVersion Include="xunit.v3.runner.inproc.console" Version="$(XUnitV3Version)" />
</ItemGroup>
</Project>
3 changes: 1 addition & 2 deletions test/EFCore.Analyzers.Tests/EFCore.Analyzers.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
Expand Down Expand Up @@ -34,7 +34,6 @@
<Using Include="Microsoft.Extensions.Logging" />
<Using Include="Microsoft.Extensions.DependencyInjection" />
<Using Include="Xunit" />
<Using Include="Xunit.Abstractions" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.CodeAnalysis;
Expand All @@ -9,7 +9,7 @@ namespace Microsoft.EntityFrameworkCore;

public class InternalUsageDiagnosticAnalyzerTests
{
[ConditionalFact]
[Fact]
public Task Invocation_on_type_in_internal_namespace()
=> VerifySingleInternalUsageAsync(
"""
Expand All @@ -25,7 +25,7 @@ void M()
}
""", "Microsoft.EntityFrameworkCore.Internal.MethodInfoExtensions");

[ConditionalFact]
[Fact]
public Task Instantiation_on_type_in_internal_namespace()
=> VerifySingleInternalUsageAsync(
"""
Expand All @@ -38,7 +38,7 @@ void M()
}
""", "Microsoft.EntityFrameworkCore.Infrastructure.Internal.CoreSingletonOptions");

[ConditionalFact]
[Fact]
public async Task Base_type()
{
var source = """
Expand All @@ -62,7 +62,7 @@ await VerifyCS.VerifyAnalyzerAsync(
.WithArguments("Microsoft.EntityFrameworkCore.Storage.Internal.RawRelationalParameter"));
}

[ConditionalFact]
[Fact]
public Task Implemented_interface()
=> VerifySingleInternalUsageAsync(
"""
Expand All @@ -77,7 +77,7 @@ class {|#0:MyClass|} : IDbSetSource
}
""", "Microsoft.EntityFrameworkCore.Internal.IDbSetSource");

[ConditionalFact]
[Fact]
public Task Access_property_with_internal_attribute()
=> VerifySingleInternalUsageAsync(
"""
Expand All @@ -90,7 +90,7 @@ void M()
}
""", "Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkRelationalServicesBuilder.RelationalServices");

[ConditionalFact]
[Fact]
public Task Instantiation_with_ctor_with_internal_attribute()
=> VerifySingleInternalUsageAsync(
"""
Expand All @@ -103,7 +103,7 @@ void M()
}
""", "Microsoft.EntityFrameworkCore.Update.UpdateSqlGeneratorDependencies");

[ConditionalFact]
[Fact]
public Task Local_variable_declaration()
=> VerifySingleInternalUsageAsync(
"""
Expand All @@ -116,7 +116,7 @@ void M()
}
""", "Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IStateManager");

[ConditionalFact]
[Fact]
public Task Generic_type_parameter_in_method_call()
=> VerifySingleInternalUsageAsync(
"""
Expand All @@ -131,7 +131,7 @@ void SomeGenericMethod<T>() {}
}
""", "Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IStateManager");

[ConditionalFact]
[Fact]
public Task Typeof()
=> VerifySingleInternalUsageAsync(
"""
Expand All @@ -144,7 +144,7 @@ void M()
}
""", "Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IStateManager");

[ConditionalFact]
[Fact]
public Task Field_declaration()
=> VerifySingleInternalUsageAsync(
"""
Expand All @@ -154,7 +154,7 @@ class MyClass
}
""", "Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IStateManager");

[ConditionalFact]
[Fact]
public Task Property_declaration()
=> VerifySingleInternalUsageAsync(
"""
Expand All @@ -164,7 +164,7 @@ class MyClass
}
""", "Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IStateManager");

[ConditionalFact]
[Fact]
public Task Method_declaration_return_type()
=> VerifySingleInternalUsageAsync(
"""
Expand All @@ -174,7 +174,7 @@ class MyClass
}
""", "Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IStateManager");

[ConditionalFact]
[Fact]
public Task Method_declaration_parameter()
=> VerifySingleInternalUsageAsync(
"""
Expand All @@ -184,7 +184,7 @@ private void Foo({|#0:Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ISta
}
""", "Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IStateManager");

[ConditionalFact]
[Fact]
public Task No_warning_on_non_internal()
=> VerifyCS.VerifyAnalyzerAsync(
"""
Expand All @@ -198,7 +198,7 @@ void M()
}
""");

[ConditionalFact]
[Fact]
public Task No_warning_in_same_assembly()
=> VerifyCS.VerifyAnalyzerAsync(
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Microsoft.EntityFrameworkCore;

public class UninitializedDbSetDiagnosticSuppressorTests
{
[ConditionalFact]
[Fact]
public Task DbSet_property_on_DbContext_is_suppressed()
=> VerifySingleSuppressionAsync(
"""
Expand All @@ -24,7 +24,7 @@ public class Blog
}
""");

[ConditionalFact]
[Fact]
public Task Non_public_DbSet_property_on_DbContext_is_suppressed()
=> VerifySingleSuppressionAsync(
"""
Expand All @@ -39,7 +39,7 @@ public class Blog
}
""");

[ConditionalFact]
[Fact]
public Task DbSet_property_with_non_public_setter_on_DbContext_is_suppressed()
=> VerifySingleSuppressionAsync(
"""
Expand All @@ -54,7 +54,7 @@ public class Blog
}
""");

[ConditionalFact]
[Fact]
public Task DbSet_property_without_setter_on_DbContext_is_not_suppressed()
=> VerifySingleSuppressionAsync(
"""
Expand All @@ -69,7 +69,7 @@ public class Blog
}
""", isSuppressed: false);

[ConditionalFact]
[Fact]
public Task Static_DbSet_property_on_DbContext_is_not_suppressed()
=> VerifySingleSuppressionAsync(
"""
Expand All @@ -84,7 +84,7 @@ public class Blog
}
""", isSuppressed: false);

[ConditionalFact]
[Fact]
public Task Non_DbSet_property_on_DbContext_is_not_suppressed()
=> VerifySingleSuppressionAsync(
"""
Expand All @@ -94,7 +94,7 @@ public class MyDbContext : Microsoft.EntityFrameworkCore.DbContext
}
""", isSuppressed: false);

[ConditionalFact]
[Fact]
public Task DbSet_property_on_non_DbContext_is_not_suppressed()
=> VerifySingleSuppressionAsync(
"""
Expand All @@ -109,7 +109,7 @@ public class Blog
}
""", isSuppressed: false);

[ConditionalFact]
[Fact]
public async Task DbSet_property_on_DbContext_with_ctor_is_suppressed()
{
var source = """
Expand Down Expand Up @@ -140,7 +140,7 @@ public class Blog
}.RunAsync();
}

[ConditionalFact]
[Fact]
public async Task DbSet_property_on_DbContext_with_ctors_is_suppressed()
{
var source = """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.EntityFrameworkCore.Design.Internal;
using Microsoft.EntityFrameworkCore.Internal;
using Microsoft.EntityFrameworkCore.TestUtilities.Xunit;

namespace Microsoft.EntityFrameworkCore;

public class AppServiceProviderFactoryTest
{
[ConditionalFact]
[Fact]
public void Create_services_from_template_method()
{
TestCreateServices(typeof(ProgramWithBuildWebHost));
Expand Down Expand Up @@ -57,8 +55,7 @@ public static TestWebHostBuilder CreateHostBuilder(string[] args)
}
}

[ConditionalFact]
[PlatformSkipCondition(TestUtilities.Xunit.TestPlatform.Mac)]
[Fact, SkipOnPlatform(TestPlatforms.OSX, "Test does not run on macOS")]
public void Create_with_no_builder_method()
{
var factory = new TestAppServiceProviderFactory(
Expand Down Expand Up @@ -95,7 +92,7 @@ private static ServiceProvider BuildTestServiceProvider()

private class TestService;

[ConditionalFact]
[Fact]
public void Create_works_when_no_BuildWebHost()
{
var factory = new TestAppServiceProviderFactory(
Expand All @@ -108,7 +105,7 @@ public void Create_works_when_no_BuildWebHost()

private class ProgramWithoutBuildWebHost;

[ConditionalFact]
[Fact]
public void Create_works_when_BuildWebHost_throws()
{
var reporter = new TestOperationReporter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
<Using Include="Microsoft.Extensions.Logging" />
<Using Include="Microsoft.Extensions.DependencyInjection" />
<Using Include="Xunit" />
<Using Include="Xunit.Abstractions" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading
Loading