Skip to content

Commit

Permalink
Updating so the Http and Bolt versions work (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Skardon committed Sep 5, 2020
1 parent 4c6f360 commit 2d5433a
Show file tree
Hide file tree
Showing 11 changed files with 129 additions and 134 deletions.
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

0 comments on commit 2d5433a

Please sign in to comment.