diff --git a/test/Providers.GremlinServer.Tests/IntegrationTests.TimeSpan_from_float.verified.txt b/test/Providers.GremlinServer.Tests/IntegrationTests.TimeSpan_from_float.verified.txt new file mode 100644 index 000000000..8f8d607ca --- /dev/null +++ b/test/Providers.GremlinServer.Tests/IntegrationTests.TimeSpan_from_float.verified.txt @@ -0,0 +1,3 @@ +[ + 00:00:00.0423000 +] \ No newline at end of file diff --git a/test/Providers.GremlinServer.Tests/IntegrationTests.TimeSpan_from_int.verified.txt b/test/Providers.GremlinServer.Tests/IntegrationTests.TimeSpan_from_int.verified.txt new file mode 100644 index 000000000..1070de014 --- /dev/null +++ b/test/Providers.GremlinServer.Tests/IntegrationTests.TimeSpan_from_int.verified.txt @@ -0,0 +1,3 @@ +[ + 00:00:00.0420000 +] \ No newline at end of file diff --git a/test/Providers.GremlinServer.Tests/IntegrationTests.cs b/test/Providers.GremlinServer.Tests/IntegrationTests.cs index 83ab3ceb6..21bfba70d 100644 --- a/test/Providers.GremlinServer.Tests/IntegrationTests.cs +++ b/test/Providers.GremlinServer.Tests/IntegrationTests.cs @@ -1,4 +1,5 @@ using ExRam.Gremlinq.Core; +using ExRam.Gremlinq.Core.Execution; using ExRam.Gremlinq.Tests.Fixtures; using ExRam.Gremlinq.Tests.Infrastructure; @@ -195,6 +196,27 @@ public Task DateTimeOffset_from_string_3() => _g .Cast() .Verify(); + [Fact] + public Task TimeSpan_from_int() => _g + .Inject(42) + .Cast() + .Verify(); + + [Fact] + public Task TimeSpan_from_float() => _g + .Inject(42.3) + .Cast() + .Verify(); + + [Fact] + public Task TimeSpan_from_malformed_string() => _g + .Inject("abc") + .Cast() + .Awaiting(_ => _ + .FirstOrDefaultAsync()) + .Should() + .ThrowAsync(); + [Fact] public async Task Deserialization_of_typed_results_is_only_called_once() {