Skip to content

Commit

Permalink
ExecuteQuery API ready for release (#700)
Browse files Browse the repository at this point in the history
* Transformation fluent working

* tidying up; xml docs

* remove wrong file

* Licensing text

* Fix build problem

* Transformation fluent working

* tidying up; xml docs

* remove wrong file

* Licensing text

* Fix build problem

* fixups

* Map/Filter/Reduce working (no xml docs)

* Tests for stream processor

* XML docs

* Review notes part 1

* Review notes part 2

* CofigureAwaits

* readme

* Docs fixes

* Spelling

* ConfigureAwait
  • Loading branch information
RichardIrons-neo4j authored Apr 28, 2023
1 parent 1b630d6 commit 815281a
Show file tree
Hide file tree
Showing 39 changed files with 1,086 additions and 412 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ public async Task GetNotification()
notification.Code.Should().NotBeNullOrEmpty();
notification.Description.Should().NotBeNullOrEmpty();
notification.Title.Should().NotBeNullOrEmpty();
notification.Severity.Should().NotBeNullOrEmpty();
notification.RawSeverityLevel.Should().NotBeNullOrEmpty();

#pragma warning disable CS0618 // deprecated method
notification.Severity.Should().Be(notification.RawSeverityLevel);
#pragma warning restore CS0618

notification.Position.Should().NotBeNull();
}
finally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public static bool IsClusterProvided()
var uri = Environment.GetEnvironmentVariable(ClusterUri);
var password = Environment.GetEnvironmentVariable(ClusterPassword);
// both of the two above env var should be provided.
return !uri.IsNullOrEmpty() && !password.IsNullOrEmpty();
return !string.IsNullOrEmpty(uri) && !string.IsNullOrEmpty(password);
}

private static string GetEnvOrThrow(string env)
{
var value = Environment.GetEnvironmentVariable(env);
if (value.IsNullOrEmpty())
if (string.IsNullOrEmpty(value))
{
throw new ArgumentException($"Missing env variable {env}");
}
Expand All @@ -62,6 +62,6 @@ private static string GetEnvOrThrow(string env)
private static string GetEnvOrDefault(string env, string defaultValue)
{
var value = Environment.GetEnvironmentVariable(env);
return value.IsNullOrEmpty() ? defaultValue : value;
return string.IsNullOrEmpty(value) ? defaultValue : value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
</PropertyGroup>
<ItemGroup>
<Content Include="App.config" />
<PackageReference Include="Castle.Core" Version="4.4.1" />
<PackageReference Include="Castle.Core" Version="5.1.1" />
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="5.0.0" />
<PackageReference Include="Moq" Version="4.15.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.8" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
<PackageReference Include="TeamCity.VSTest.TestAdapter" Version="1.0.23" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Neo4j.Driver.Preview;
using Newtonsoft.Json;

namespace Neo4j.Driver.Tests.TestBackend;
Expand Down Expand Up @@ -62,7 +61,7 @@ async Task NotifyBookmarks(string[] bookmarks, CancellationToken _)
}

BookmarkManager =
Preview.GraphDatabase.BookmarkManagerFactory.NewBookmarkManager(
GraphDatabase.BookmarkManagerFactory.NewBookmarkManager(
new BookmarkManagerConfig(initialBookmarks, BookmarkSupplier, NotifyBookmarks));

return Task.CompletedTask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal class DriverClose : IProtocolObject
public override async Task Process()
{
var driver = ((NewDriver)ObjManager.GetObject(data.driverId)).Driver;
await driver.CloseAsync();
await driver.DisposeAsync();
}

public override string Respond()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Neo4j.Driver.Preview;
using Newtonsoft.Json;

namespace Neo4j.Driver.Tests.TestBackend;
Expand All @@ -28,7 +27,8 @@ internal class ExecuteQuery : IProtocolObject
{
public ExecuteQueryDto data { get; set; }

[JsonIgnore] public EagerResult<IReadOnlyList<IRecord>> Result { get; set; }
[JsonIgnore]
public EagerResult<IReadOnlyList<IRecord>> Result { get; set; }

public override async Task Process()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static Dictionary<string, object> ConvertDictionaryToNative(

internal class SimpleValue
{
public object? value { get; set; }
public object value { get; set; }
}

public class DateTimeParameterValue
Expand Down
1 change: 0 additions & 1 deletion Neo4j.Driver/Neo4j.Driver.Tests/AsyncSessionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
using Neo4j.Driver.Internal.MessageHandling;
using Neo4j.Driver.Internal.Messaging;
using Neo4j.Driver.Internal.Routing;
using Neo4j.Driver.Preview;
using Xunit;

namespace Neo4j.Driver.Tests
Expand Down
Loading

0 comments on commit 815281a

Please sign in to comment.