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 tests for TimeSpan deserialization. #1724

Merged
merged 1 commit into from
Sep 6, 2024
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
@@ -0,0 +1,3 @@
[
00:00:00.0423000
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
00:00:00.0420000
]
22 changes: 22 additions & 0 deletions test/Providers.GremlinServer.Tests/IntegrationTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ExRam.Gremlinq.Core;
using ExRam.Gremlinq.Core.Execution;
using ExRam.Gremlinq.Tests.Fixtures;
using ExRam.Gremlinq.Tests.Infrastructure;

Expand Down Expand Up @@ -195,6 +196,27 @@ public Task DateTimeOffset_from_string_3() => _g
.Cast<DateTimeOffset>()
.Verify();

[Fact]
public Task TimeSpan_from_int() => _g
.Inject(42)
.Cast<TimeSpan>()
.Verify();

[Fact]
public Task TimeSpan_from_float() => _g
.Inject(42.3)
.Cast<TimeSpan>()
.Verify();

[Fact]
public Task TimeSpan_from_malformed_string() => _g
.Inject("abc")
.Cast<TimeSpan>()
.Awaiting(_ => _
.FirstOrDefaultAsync())
.Should()
.ThrowAsync<GremlinQueryExecutionException>();

[Fact]
public async Task Deserialization_of_typed_results_is_only_called_once()
{
Expand Down