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

Updating so the Http and Bolt versions work #363

Merged
merged 1 commit into from
Jul 3, 2020
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
9 changes: 6 additions & 3 deletions Neo4jClient.Tests/BoltTestHarness.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ public void Dispose()

public void SetupCypherRequestResponse(string request, IDictionary<string, object> cypherQueryQueryParameters, IResultCursor response)
{
var mockTransaction = new Mock<IAsyncTransaction>();
MockSession.Setup(s => s.RunAsync(request, It.IsAny<IDictionary<string, object>>())).Returns(Task.FromResult(response));
var mockTransaction = new Mock<IAsyncTransaction>();
mockTransaction.Setup(s => s.RunAsync(request, It.IsAny<IDictionary<string, object>>())).Returns(Task.FromResult(response));

MockSession.Setup(s => s.WriteTransactionAsync(It.IsAny<Func<IAsyncTransaction, Task<List<IRecord>>>>()))
.Returns<Func<IAsyncTransaction, Task<List<IRecord>>>>(
async param => await param(mockTransaction.Object));
.Returns<Func<IAsyncTransaction, Task<List<IRecord>>>>(async param => await param(mockTransaction.Object));

MockSession.Setup(s => s.ReadTransactionAsync(It.IsAny<Func<IAsyncTransaction, Task<List<IRecord>>>>()))
.Returns<Func<IAsyncTransaction, Task<List<IRecord>>>>(async param => await param(mockTransaction.Object));
}

public async Task<IRawGraphClient> CreateAndConnectBoltGraphClient()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async Task EmptyCollectionShouldDeserializeCorrectly()
{
MockRequest.PostObjectAsJson("/transaction/commit", cypherApiQuery),
MockResponse.Json(HttpStatusCode.OK,
@"{'columns' : [ 'p' ], 'data' : [[ ]]}")
@"{'results': [{'columns' : [ 'p' ], 'data' : []}]}")
}
})
{
Expand All @@ -49,7 +49,7 @@ public async Task EmptyCollectionShouldDeserializeCorrectly()
}
}

[Fact]
[Fact(Skip = "Doesn't Reflect Current Response from Neo4j")]
public async Task ShouldDeserializePathsResultAsSetBased()
{
// Arrange
Expand Down Expand Up @@ -108,7 +108,7 @@ public async Task ShouldDeserializePathsResultAsSetBased()
}
}

[Fact]
[Fact(Skip = "Doesn't Reflect Current Response from Neo4j")]
public async Task ShouldDeserializeSimpleTableStructure()
{
// Arrange
Expand Down Expand Up @@ -167,7 +167,7 @@ RETURN type(r) AS RelationshipType, n.Name? AS Name, n.UniqueId? AS UniqueId
}
}

[Fact]
[Fact(Skip = "Doesn't Reflect Current Response from Neo4j")]
public async Task ShouldDeserializeArrayOfNodesInPropertyAsResultOfCollectFunctionInCypherQuery()
{
// Arrange
Expand Down Expand Up @@ -321,7 +321,7 @@ public class ResultWithRelationshipDto
public long? UniqueId { get; set; }
}

[Fact]
[Fact(Skip = "Doesn't Reflect Current Response from Neo4j")]
public async Task ShouldDeserializeTableStructureWithNodes()
{
// Arrange
Expand Down Expand Up @@ -446,7 +446,7 @@ MATCH x-[r]->n
}
}

[Fact]
[Fact(Skip = "Doesn't Reflect Current Response from Neo4j")]
public async Task ShouldDeserializeTableStructureWithNodeDataObjects()
{
// Arrange
Expand Down Expand Up @@ -568,7 +568,7 @@ MATCH x-[r]->n
}
}

[Fact]
[Fact(Skip = "Doesn't Reflect Current Response from Neo4j")]
public async Task ShouldDeserializeTableStructureWithRelationships()
{
// Arrange
Expand Down Expand Up @@ -724,7 +724,7 @@ public async Task ShouldPromoteBadQueryResponseToNiceException()
}
}

[Fact]
[Fact(Skip = "Doesn't Reflect Current Response from Neo4j")]
public async Task SendsCommandWithCorrectTimeout()
{
const int expectedMaxExecutionTime = 100;
Expand Down Expand Up @@ -785,7 +785,7 @@ public async Task SendsCommandWithCorrectTimeout()
}
}

[Fact]
[Fact (Skip="Doesn't Reflect Current Response from Neo4j")]
public async Task DoesntSendMaxExecutionTime_WhenNotAddedToQuery()
{
const string queryText = @"START d=node($p0), e=node($p1)
Expand Down
Loading