Skip to content
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

Be consistent about using ConditionalFact and ConditionalTheory #27558

Merged
merged 1 commit into from
Mar 4, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Microsoft.EntityFrameworkCore.Migrations.Design;

public class MigrationsBundleTest
{
[Fact]
[ConditionalFact]
public void Short_names_are_unique()
{
foreach (var command in GetCommands())
Expand All @@ -24,7 +24,7 @@ public void Short_names_are_unique()
}
}

[Fact]
[ConditionalFact]
public void Long_names_are_unique()
{
foreach (var command in GetCommands())
Expand All @@ -41,7 +41,7 @@ public void Long_names_are_unique()
}
}

[Fact]
[ConditionalFact]
public void HandleResponseFiles_is_true()
{
var app = new CommandLineApplication { Name = "efbundle" };
Expand All @@ -50,7 +50,7 @@ public void HandleResponseFiles_is_true()
Assert.True(app.HandleResponseFiles);
}

[Fact]
[ConditionalFact]
public void AllowArgumentSeparator_is_true()
{
var app = new CommandLineApplication { Name = "efbundle" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ public virtual void Primary_key_is_stored_in_snapshot()
);
});

[Fact]
[ConditionalFact]
public void HasNoKey_is_handled()
=> Test(
builder => builder.Entity<EntityWithOneProperty>().Ignore(e => e.EntityWithTwoProperties).HasNoKey(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ public virtual Task Alter_column_remove_comment()
Assert.Null(column.Comment);
});

[Fact]
[ConditionalFact]
public virtual Task Alter_column_set_collation()
=> Test(
builder => builder.Entity("People").Property<string>("Name"),
Expand All @@ -951,7 +951,7 @@ public virtual Task Alter_column_set_collation()
}
});

[Fact]
[ConditionalFact]
public virtual Task Alter_column_reset_collation()
=> Test(
builder => builder.Entity("People").Property<string>("Name"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Microsoft.EntityFrameworkCore.Migrations.Operations;

public class CreateIndexOperationTest
{
[Fact]
[ConditionalFact]
public void IsDescending_count_matches_column_count()
{
var operation = new CreateIndexOperation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Microsoft.EntityFrameworkCore.Query.Internal;

public class QuerySqlGeneratorTest
{
[Theory]
[ConditionalTheory]
[InlineData("INSERT something")]
[InlineData("SELECTANDSOMEOTHERSTUFF")]
[InlineData("SELECT")]
Expand All @@ -29,7 +29,7 @@ public void CheckComposableSql_throws(string sql)
() => CreateDummyQuerySqlGenerator().CheckComposableSql(sql.Replace("SELECT", "WITH"))).Message);
}

[Theory]
[ConditionalTheory]
[InlineData("SELECT something")]
[InlineData(" SELECT something")]
[InlineData("-- comment\n SELECT something")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public SqlServerMigrationsAnnotationProviderTest()
_annotations = new SqlServerAnnotationProvider(new RelationalAnnotationProviderDependencies());
}

[Fact]
[ConditionalFact]
public void For_property_handles_identity_annotations()
{
var modelBuilder = SqlServerTestHelpers.Instance.CreateConventionBuilder();
Expand Down
4 changes: 2 additions & 2 deletions test/EFCore.SqlServer.Tests/SqlServerMigrationBuilderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ namespace Microsoft.EntityFrameworkCore.SqlServer.Tests;

public class SqlServerMigrationBuilderTest
{
[Fact]
[ConditionalFact]
public void IsSqlServer_when_using_SqlServer()
{
var migrationBuilder = new MigrationBuilder("Microsoft.EntityFrameworkCore.SqlServer");
Assert.True(migrationBuilder.IsSqlServer());
}

[Fact]
[ConditionalFact]
public void Not_IsSqlServer_when_using_different_provider()
{
var migrationBuilder = new MigrationBuilder("Microsoft.EntityFrameworkCore.InMemory");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ namespace Microsoft.EntityFrameworkCore.Migrations;

public class SqliteMigrationBuilderTest
{
[Fact]
[ConditionalFact]
public void IsSqlite_when_using_Sqlite()
{
var migrationBuilder = new MigrationBuilder("Microsoft.EntityFrameworkCore.Sqlite");
Assert.True(migrationBuilder.IsSqlite());
}

[Fact]
[ConditionalFact]
public void Not_IsSqlite_when_using_different_provider()
{
var migrationBuilder = new MigrationBuilder("Microsoft.EntityFrameworkCore.InMemory");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Microsoft.EntityFrameworkCore.Storage;

public class SqliteRelationalConnectionTest
{
[Fact]
[ConditionalFact]
public void Sets_DefaultTimeout_when_connectionString()
{
var services = SqliteTestHelpers.Instance.CreateContextServices(
Expand All @@ -20,7 +20,7 @@ public void Sets_DefaultTimeout_when_connectionString()
Assert.Equal(42, connection.DefaultTimeout);
}

[Fact]
[ConditionalFact]
public void Sets_DefaultTimeout_when_connection()
{
var originalConnection = new SqliteConnection("Data Source=:memory:") { DefaultTimeout = 21 };
Expand Down
2 changes: 1 addition & 1 deletion test/EFCore.Tests/DbSetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public void Direct_use_of_Set_throws_if_context_disposed()
Assert.Throws<ObjectDisposedException>(() => context.Set<Category>()).Message);
}

[Fact]
[ConditionalFact]
public void Direct_use_of_Set_for_shared_type_throws_if_context_disposed()
{
var context = new EarlyLearningCenter();
Expand Down