Skip to content

Commit

Permalink
Add new tests for deserializing to a dictionary.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcweber committed Jul 14, 2022
1 parent 4812e4c commit 542c393
Show file tree
Hide file tree
Showing 538 changed files with 51,996 additions and 8 deletions.
6 changes: 2 additions & 4 deletions test/ExRam.Gremlinq.Core.Tests/QueryDeserializationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ public abstract class QueryDeserializationTest : QueryExecutionTest
{
public abstract class Fixture : GremlinqTestFixture
{
protected Fixture(IGremlinQuerySource source) : base(source
protected Fixture(string sourcePrefix, IGremlinQuerySource source) : base(source
.ConfigureEnvironment(env => env
.UseExecutor(GremlinQueryExecutor.Create((_, _) =>
{
var context = XunitContext.Context;
var prefix = context.ClassName.Substring(0, context.ClassName.Length - "DeserializationTests".Length);
try
{
var jArray = JsonConvert.DeserializeObject<JArray>(
File.ReadAllText(System.IO.Path.Combine(context.SourceDirectory, prefix + "IntegrationTests." + XunitContext.Context.MethodName + ".verified.txt")));
File.ReadAllText(System.IO.Path.Combine(context.SourceDirectory, sourcePrefix + "." + XunitContext.Context.MethodName + ".verified.txt")));
return jArray?
.Select(x => (object)x)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ public sealed class CosmosDbDeserializationTests : QueryDeserializationTest, ICl
{
public new sealed class Fixture : QueryDeserializationTest.Fixture
{
public Fixture() : base(g
.UseCosmosDb(_ => _.At("ws://localhost", "", "").AuthenticateBy("")))
public Fixture() : base(
nameof(CosmosDbIntegrationTests),
g.UseCosmosDb(_ => _.At("ws://localhost", "", "").AuthenticateBy("")))
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ public sealed class GremlinServerDeserializationTests : QueryDeserializationTest
{
public new sealed class Fixture : QueryDeserializationTest.Fixture
{
public Fixture() : base(g
.UseGremlinServer(_ => _))
public Fixture() : base(
nameof(GremlinServerIntegrationTests),
g.UseGremlinServer(_ => _))
{
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"Name": null,
"Languages": null,
"CountryCallingCode": null,
"LocalizableDescription": null,
"Id": -1,
"Label": "Country"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"Age": 0,
"Gender": null,
"Image": null,
"RegistrationDate": null,
"PhoneNumbers": null,
"SomeObscureProperty": null,
"Name": null,
"Id": -1,
"Label": "Person"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"Role": null,
"From": "0001-01-01T00:00:00",
"To": "2020-04-07T14:43:36Z",
"Id": -1,
"Label": "WorksFor"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"Id": -1,
"Label": "Speaks"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"Role": "Admin",
"From": "2020-04-07T14:43:36Z",
"To": "2020-04-07T14:43:36Z",
"Id": -1,
"Label": "WorksFor"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"Since": null,
"Id": -1,
"Label": "LivesIn"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"Since": {
"Value": "2020-04-07T14:43:36+00:00",
"Key": null
},
"Id": -1,
"Label": "LivesIn"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"Id": -1,
"Label": "Speaks"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"Role": "Admin",
"From": "2020-04-07T14:43:36Z",
"To": "2020-04-07T14:43:36Z",
"Id": -1,
"Label": "WorksFor"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"Since": null,
"Id": -1,
"Label": "LivesIn"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"IetfLanguageTag": "en",
"Id": -1,
"Label": "Language"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"Enabled": false,
"StartTime": "08:00:00",
"Duration": "02:00:00",
"Id": -1,
"Label": "TimeFrame"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[
{
"Age": 0,
"Gender": null,
"Image": null,
"RegistrationDate": "2020-04-07T14:43:36+00:00",
"PhoneNumbers": null,
"SomeObscureProperty": null,
"Name": {
"Id": -1,
"Label": "Name",
"Properties": {
"ValidFrom": "0001-01-01T00:00:00+00:00"
},
"Value": "Marko",
"Key": null
},
"Id": -1,
"Label": "Person"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"IetfLanguageTag": null,
"Id": -1,
"Label": "Language"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{
"FoundingDate": "0001-01-01T00:00:00",
"PhoneNumbers": null,
"Locations": [
{
"Id": -1,
"Label": "Locations",
"Properties": {
"ValidFrom": "2019-01-01T01:00:00+00:00"
},
"Value": "Aachen",
"Key": null
}
],
"Name": null,
"Id": -1,
"Label": "Company"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[
{
"Name": {
"Id": -1,
"Label": "Name",
"Properties": {
"de": "Deutschland",
"en": "Germany"
},
"Value": "GER",
"Key": null
},
"Languages": null,
"CountryCallingCode": null,
"LocalizableDescription": null,
"Id": -1,
"Label": "Country"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"Name": {
"Id": -1,
"Label": "Name",
"Properties": {},
"Value": "GER",
"Key": null
},
"Languages": null,
"CountryCallingCode": null,
"LocalizableDescription": null,
"Id": -1,
"Label": "Country"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"Age": 0,
"Gender": null,
"Image": "AQIDBAUGBwg=",
"RegistrationDate": null,
"PhoneNumbers": null,
"SomeObscureProperty": null,
"Name": null,
"Id": -1,
"Label": "Person"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"Age": 0,
"Gender": 1,
"Image": null,
"RegistrationDate": null,
"PhoneNumbers": null,
"SomeObscureProperty": null,
"Name": null,
"Id": -1,
"Label": "Person"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"IetfLanguageTag": "en",
"Id": -1,
"Label": "Language"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"IetfLanguageTag": null,
"Id": -1,
"Label": "Language"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"FoundingDate": "0001-01-01T00:00:00",
"PhoneNumbers": [
"+4912345",
"+4923456"
],
"Locations": null,
"Name": null,
"Id": -1,
"Label": "Company"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"IetfLanguageTag": null,
"Id": -1,
"Label": "Language"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"IetfLanguageTag": "en",
"Id": -1,
"Label": "Language"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"IetfLanguageTag": "en",
"Id": -1,
"Label": "Language"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"id": -1,
"label": "Language",
"properties": {
"IetfLanguageTag": [
{
"id": -1,
"label": "IetfLanguageTag",
"value": "en",
"properties": {}
}
]
}
}
]
Loading

0 comments on commit 542c393

Please sign in to comment.