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

Add failing test for indexing of nota time types #2413

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
36 changes: 36 additions & 0 deletions src/Marten.NodaTime.Testing/Acceptance/noda_time_acceptance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,42 @@ public async Task can_append_and_query_events(SerializerType serializerType)
}
}

[Theory]
[InlineData(SerializerType.SystemTextJson)]
[InlineData(SerializerType.Newtonsoft)]
public void can_index_noda_time_types(SerializerType serializerType)
{
StoreOptions(_ =>
{
_.UseDefaultSerialization(serializerType: serializerType);
_.UseNodaTime();
_.Schema.For<TargetWithDates>().Index(x => x.LocalDate);
}, true);
Should
.NotThrow(() => theStore.Schema.ApplyAllConfiguredChangesToDatabaseAsync(),
"Index creation failed for LocalDate");

StoreOptions(_ =>
{
_.UseDefaultSerialization(serializerType: serializerType);
_.UseNodaTime();
_.Schema.For<TargetWithDates>().Index(x => x.LocalDateTime);
}, true);
Should
.NotThrow(() => theStore.Schema.ApplyAllConfiguredChangesToDatabaseAsync(),
"Index creation failed for LocalDateTime");

StoreOptions(_ =>
{
_.UseDefaultSerialization(serializerType: serializerType);
_.UseNodaTime();
_.Schema.For<TargetWithDates>().Index(x => x.InstantUTC);
}, true);
Should
.NotThrow(() => theStore.Schema.ApplyAllConfiguredChangesToDatabaseAsync(),
"Index creation failed for Instant");
}

[Theory]
[InlineData(SerializerType.SystemTextJson)]
[InlineData(SerializerType.Newtonsoft)]
Expand Down