Skip to content

Commit

Permalink
Add tests for TimeSpan deserialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcweber committed Sep 6, 2024
1 parent f671fdd commit 398ed10
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
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

0 comments on commit 398ed10

Please sign in to comment.