Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,11 @@
using Weasel.Core;
using Weasel.Postgresql;
using Xunit;
using Xunit.Abstractions;

namespace CoreTests.Bugs;

public class Bug_1258_cannot_derive_updates_for_objects: BugIntegrationContext
{
private readonly ITestOutputHelper _output;

public Bug_1258_cannot_derive_updates_for_objects(ITestOutputHelper output)
{
_output = output;
}

[Fact]
public async Task can_properly_detect_changes_when_user_defined_type()
Expand All @@ -38,7 +31,6 @@ public async Task can_properly_detect_changes_when_user_defined_type()
});
opts.Schema.For<UserWithCustomType>().GinIndexJsonData();

opts.Logger(new TestOutputMartenLogger(_output));
});

var guyWithCustomType1 = new UserWithCustomType { Id = Guid.NewGuid(), Name = "test_guy", CustomType = "test_cust_type" };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,23 @@
using System.Diagnostics;
using System.Threading.Tasks;
using Marten.Testing.Harness;
using Xunit;
using Xunit.Abstractions;

namespace CoreTests.Bugs;

public class Bug_2914_NGram_index_being_changed_incorrectly : BugIntegrationContext
{
private readonly ITestOutputHelper _output;

public Bug_2914_NGram_index_being_changed_incorrectly(ITestOutputHelper output)
{
_output = output;
}

[Fact]
public async Task recognize_when_it_is_correct()
{
StoreOptions(opts =>
{
opts.Logger(new TestOutputMartenLogger(_output));
opts.Schema.For<NGramDoc>().NgramIndex(x => x.NGramString);
});

await theStore.Storage.Database.EnsureStorageExistsAsync(typeof(NGramDoc));

var store = SeparateStore(opts =>
{
opts.Logger(new TestOutputMartenLogger(_output));
opts.Schema.For<NGramDoc>().NgramIndex(x => x.NGramString);
});

Expand Down
9 changes: 0 additions & 9 deletions src/CoreTests/DocumentCleanerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,13 @@
using Marten.Testing.Harness;
using Shouldly;
using Xunit;
using Xunit.Abstractions;

namespace CoreTests;

public class DocumentCleanerTests: OneOffConfigurationsContext
{
private readonly ITestOutputHelper _output;
private IDocumentCleaner theCleaner => theStore.Advanced.Clean;

public DocumentCleanerTests(ITestOutputHelper output)
{
_output = output;
}

[Fact]
public async Task clean_table()
{
Expand Down Expand Up @@ -145,8 +138,6 @@ public async Task delete_all_event_data()
[Fact]
public async Task delete_all_event_data_async()
{
theSession.Logger = new TestOutputMartenLogger(_output);

theSession.QueueOperation(new InsertProjectionProgress(theStore.Events,
new EventRange(new ShardName("Projection1", "All", 1), 1000)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Weasel.Postgresql;
using Xunit;

namespace DocumentDbTests.ForeignKeys;
namespace CoreTests.ForeignKeys;

public class foreign_keys: OneOffConfigurationsContext
{
Expand Down
9 changes: 0 additions & 9 deletions src/CoreTests/Partitioning/partitioning_configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,11 @@
using Weasel.Postgresql;
using Weasel.Postgresql.Tables.Partitioning;
using Xunit;
using Xunit.Abstractions;

namespace CoreTests.Partitioning;

public class partitioning_configuration : OneOffConfigurationsContext
{
private readonly ITestOutputHelper _output;

public partitioning_configuration(ITestOutputHelper output)
{
_output = output;
}

private DocumentTable tableFor<T>()
{
var mapping = theStore.Options.Storage.MappingFor(typeof(T));
Expand Down Expand Up @@ -76,7 +68,6 @@ public async Task actually_build_out_partitioned_tables()
StoreOptions(opts =>
{
opts.Schema.For<Target>().SoftDeletedWithPartitioning();
opts.Logger(new TestOutputMartenLogger(_output));
});

await theStore.Storage.ApplyAllConfiguredChangesToDatabaseAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,11 @@
using Marten.Testing.Harness;
using Shouldly;
using Xunit;
using Xunit.Abstractions;

namespace CoreTests.Partitioning;

public class querying_against_conjoined_partitioning_with_tenant_id_and_subquery : OneOffConfigurationsContext
{
private readonly ITestOutputHelper _output;

public querying_against_conjoined_partitioning_with_tenant_id_and_subquery(ITestOutputHelper output)
{
_output = output;
}

[Fact]
public async Task do_not_bleed_tenant_data_because_of_select_queries()
{
Expand All @@ -39,7 +31,6 @@ public async Task do_not_bleed_tenant_data_because_of_select_queries()
await theStore.BulkInsertAsync("blue", blues);

using var session = theStore.LightweightSession("red");
session.Logger = new TestOutputMartenLogger(_output);

var matching = await session.Query<Target>()
.Where(x => x.Children.Any(c => c.Number > 8))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ public void add_marten_by_store_options_with_custom_logger()
{
var options = new StoreOptions();
options.Connection(ConnectionSource.ConnectionString);
options.Logger(new TestOutputMartenLogger(null));
options.Logger(new ConsoleMartenLogger());
return options;
});
});

var store = container.GetRequiredService<IDocumentStore>();
store.Options.Logger().ShouldBeOfType<TestOutputMartenLogger>();
store.Options.Logger().ShouldBeOfType<ConsoleMartenLogger>();
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@
using Marten.Testing.Harness;
using Shouldly;
using Xunit;
using Xunit.Abstractions;

namespace DocumentDbTests.Bugs;

public class Bug_1416_foreign_key_with_document_alias : BugIntegrationContext
{
private readonly ITestOutputHelper _output;

public Bug_1416_foreign_key_with_document_alias(ITestOutputHelper output)
{
_output = output;
}

[Fact]
public async Task use_the_correct_naming()
Expand Down
8 changes: 0 additions & 8 deletions src/DocumentDbTests/Bugs/Bug_1429_fk_ordering_problems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,17 @@
using Weasel.Core;
using Weasel.Postgresql;
using Xunit;
using Xunit.Abstractions;

namespace DocumentDbTests.Bugs;

public class Bug_1429_fk_ordering_problems : OneOffConfigurationsContext
{
private readonly ITestOutputHelper _output;

public Bug_1429_fk_ordering_problems(ITestOutputHelper output)
{
_output = output;
}

[Fact]
public async Task try_to_persist()
{
StoreOptions(_ =>
{
_.Logger(new TestOutputMartenLogger(_output));
_.AutoCreateSchemaObjects = AutoCreate.All;
_.Schema.For<DocB>()
.AddSubClassHierarchy(typeof(DocB1), typeof(DocB2))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,11 @@
using Weasel.Core;
using Weasel.Postgresql;
using Xunit;
using Xunit.Abstractions;

namespace DocumentDbTests.Bugs
{
public class Bug_1779_null_comparison_to_foreign_key_column_not_generating_is_null : BugIntegrationContext
{
private readonly ITestOutputHelper _output;

public Bug_1779_null_comparison_to_foreign_key_column_not_generating_is_null(ITestOutputHelper output)
{
_output = output;
}

[Fact]
public async Task should_be_able_to_filter_with_null_value()
Expand All @@ -41,7 +34,6 @@ public async Task should_be_able_to_filter_with_null_value()
await session.SaveChangesAsync();

await using var querySession = documentStore.QuerySession();
querySession.Logger = new TestOutputMartenLogger(_output);

var results = await querySession.Query<HierarchyEntity>()
.Where(x => x.Name == "Test" && x.ParentId == null)
Expand Down Expand Up @@ -70,7 +62,6 @@ public async Task should_be_able_to_filter_with_null_value_and_not_equals()
await session.SaveChangesAsync();

await using var querySession = documentStore.QuerySession();
querySession.Logger = new TestOutputMartenLogger(_output);

var results = await querySession.Query<HierarchyEntity>()
.Where(x => x.Name == "Test" && x.ParentId != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,11 @@
using Marten.Testing.Harness;
using Shouldly;
using Xunit;
using Xunit.Abstractions;

namespace DocumentDbTests.Bugs;

public class Bug_1871_includes_with_snake_case_json : BugIntegrationContext
{
private readonly ITestOutputHelper _output;

public Bug_1871_includes_with_snake_case_json(ITestOutputHelper output)
{
_output = output;
}

public class Role
{
Expand Down Expand Up @@ -46,7 +39,6 @@ public async Task includes_should_work()
StoreOptions(opts =>
{
opts.UseSystemTextJsonForSerialization(casing: Casing.SnakeCase);
opts.Logger(new TestOutputMartenLogger(_output));
});

var admin = new Role {Name = "Admin"};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@
using System.Threading.Tasks;
using Marten.Testing.Harness;
using Xunit;
using Xunit.Abstractions;

namespace DocumentDbTests.Bugs;

public class Bug_1975_bulk_insert_of_nested_guid : BugIntegrationContext
{
private readonly ITestOutputHelper _output;

public Bug_1975_bulk_insert_of_nested_guid(ITestOutputHelper output)
{
_output = output;
}

[Fact]
public async Task can_bulk_insert()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,11 @@
using Marten.Testing.Harness;
using Shouldly;
using Xunit;
using Xunit.Abstractions;

namespace DocumentDbTests.Bugs;

public class Bug_1994_insert_update_on_same_object_in_transaction: BugIntegrationContext
{
private readonly ITestOutputHelper _output;

public Bug_1994_insert_update_on_same_object_in_transaction(ITestOutputHelper output)
{
_output = output;
}

[Fact]
public async Task bug_1994_pending_changes_after_insert_and_store_on_same_object()
Expand All @@ -27,8 +20,6 @@ public async Task bug_1994_pending_changes_after_insert_and_store_on_same_object
var user1 = new User();

await using var session1 = theStore.LightweightSession();
session1.Logger = new TestOutputMartenLogger(_output);

session1.Insert(user1);


Expand Down
8 changes: 0 additions & 8 deletions src/DocumentDbTests/Bugs/Bug_3378_jsonb_ops_index_syntax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,18 @@
using Marten.Storage;
using Marten.Testing.Harness;
using Xunit;
using Xunit.Abstractions;

namespace DocumentDbTests.Bugs;

public class Bug_3378_jsonb_ops_index_syntax : BugIntegrationContext
{
private readonly ITestOutputHelper _output;

public Bug_3378_jsonb_ops_index_syntax(ITestOutputHelper output)
{
_output = output;
}

[Fact]
public async Task use_same_syntax_as_query()
{
StoreOptions(opts =>
{
opts.Schema.For<SomeModel>().Index(x => x.ChildCollection, index => index.ToGinWithJsonbPathOps());
opts.Logger(new TestOutputMartenLogger(_output));
});

await theStore.Storage.Database.EnsureStorageExistsAsync(typeof(SomeModel));
Expand Down
Loading
Loading