Skip to content

Commit 8865cc9

Browse files
authored
Release Finalization (#326)
1 parent 07fb3d8 commit 8865cc9

File tree

129 files changed

+2128
-205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+2128
-205
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
_Hot Chocolate_ is a GraphQL server and parser implementation based on the current GraphQL [June 2018 specification](http://facebook.github.io/graphql/June2018/) defined by Facebook.
1010

11-
We are currently in the process of closing some gaps and hope to finalise Version 1 by September. We have listed the implemented specification parts at the bottom of this readme.
11+
We are currently in the process of closing some gaps and hope to finalise Version 1 by December. We have listed our progress toward version one at the bottom of this readme.
1212

1313
## Getting Started
1414

@@ -186,7 +186,7 @@ cd myserver
186186
dotnet new graphql-server
187187
```
188188

189-
## Features
189+
## Features and Roadmap
190190

191191
We currently support the following parts of the current [June 2018 specification](http://facebook.github.io/graphql/June2018/) of GraphQL.
192192

@@ -290,6 +290,7 @@ We are currently working on the following features that are proposed for the nex
290290
## Supported Frameworks
291291

292292
- [ ] ASP.NET Classic
293+
293294
- [ ] _Get_ (in development - 0.7.0)
294295
- [ ] _Post_ (in development - 0.7.0)
295296
- [ ] _WebSockets_ (in development - 0.8.0)

src/Core.Tests/CodeFirstTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections.Generic;
22
using System.Threading.Tasks;
3+
using ChilliCream.Testing;
34
using HotChocolate.Execution;
45
using HotChocolate.Resolvers;
56
using HotChocolate.Types;

src/Core.Tests/Core.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@
2323
<PackageReference Include="Moq" Version="4.8.1" />
2424
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.1" />
2525
<PackageReference Include="Microsoft.Extensions.DiagnosticAdapter" Version="2.1.0" />
26-
<PackageReference Include="ChilliCream.Testing.Utilities" Version="0.1.0" />
26+
<PackageReference Include="ChilliCream.Testing.Utilities" Version="0.2.0" />
2727
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
2828
</ItemGroup>
2929

3030
<ItemGroup>
3131
<ProjectReference Include="..\Core\Core.csproj" />
32+
<ProjectReference Include="..\Subscriptions.InMemory\Subscriptions.InMemory.csproj" />
3233
</ItemGroup>
3334

3435
<ItemGroup>

src/Core.Tests/Execution/ArgumentTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Threading;
44
using System.Threading.Tasks;
5+
using ChilliCream.Testing;
56
using HotChocolate.Configuration;
67
using HotChocolate.Language;
78
using HotChocolate.Types;

src/Core.Tests/Execution/Errors/ErrorTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,19 @@ public void FieldError_CreateWithoutLocation()
4949
Assert.Equal("foo", error.Extensions["fieldName"]);
5050
Assert.Null(error.Locations);
5151
}
52+
53+
[Fact]
54+
public void VariableError_CreateWithoutLocation()
55+
{
56+
// arrange
57+
// act
58+
var error = new VariableError("foo", "bar");
59+
60+
// assert
61+
Assert.Equal("foo", error.Message);
62+
Assert.Equal("bar", error.Extensions["variableName"]);
63+
Assert.Null(error.Locations);
64+
Assert.Null(error.Path);
65+
}
5266
}
5367
}

src/Core.Tests/Execution/OperationExecuterErrorTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Threading.Tasks;
3+
using ChilliCream.Testing;
34
using HotChocolate.Types;
45
using Xunit;
56

src/Core.Tests/Execution/QueryDirectiveTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Threading;
44
using System.Threading.Tasks;
5+
using ChilliCream.Testing;
56
using HotChocolate.Resolvers;
67
using HotChocolate.Runtime;
78
using HotChocolate.Types;

src/Core.Tests/Execution/QueryExecuterTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Threading.Tasks;
4+
using ChilliCream.Testing;
45
using HotChocolate.Language;
56
using Xunit;
67

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
using System;
2+
using HotChocolate.Execution;
3+
using Xunit;
4+
5+
namespace Core.Tests.Execution
6+
{
7+
public class QueryResultTests
8+
{
9+
[Fact]
10+
public void Create_OnlyData_DataIsReadOnly()
11+
{
12+
// arrange
13+
var data = new OrderedDictionary();
14+
Assert.False(data.IsReadOnly);
15+
16+
// act
17+
var result = new QueryResult(data);
18+
19+
// assert
20+
Assert.True(result.Data.IsReadOnly);
21+
Assert.True(data.IsReadOnly);
22+
}
23+
24+
[Fact]
25+
public void ToJson_OnlyData_JsonStringNoIndentations()
26+
{
27+
// arrange
28+
var data = new OrderedDictionary();
29+
var result = new QueryResult(data);
30+
31+
// act
32+
string json = result.ToJson(false);
33+
34+
35+
// assert
36+
37+
}
38+
39+
[Fact]
40+
public void Create_OnlyData_ErrorIsNull()
41+
{
42+
// arrange
43+
var data = new OrderedDictionary();
44+
45+
// act
46+
var result = new QueryResult(data);
47+
48+
// assert
49+
Assert.Null(result.Errors);
50+
}
51+
52+
[Fact]
53+
public void Create_DataIsNull_ArgumentNullException()
54+
{
55+
// arrange
56+
// act
57+
Action a = () => new QueryResult((OrderedDictionary)null);
58+
59+
// assert
60+
Assert.Throws<ArgumentNullException>(a);
61+
}
62+
63+
[Fact]
64+
public void Create_OnlyError_ErrorIsReadOnly()
65+
{
66+
// arrange
67+
var data = new OrderedDictionary();
68+
Assert.False(data.IsReadOnly);
69+
70+
// act
71+
var result = new QueryResult(data);
72+
73+
// assert
74+
Assert.True(result.Data.IsReadOnly);
75+
Assert.True(data.IsReadOnly);
76+
}
77+
78+
[Fact]
79+
public void Create_WithOneError_ContainsOneError()
80+
{
81+
// arrange
82+
QueryError error = new QueryError("foo");
83+
84+
// act
85+
var result = new QueryResult(error);
86+
87+
// assert
88+
Assert.Collection(result.Errors,
89+
t => Assert.Equal(error, t));
90+
}
91+
92+
[Fact]
93+
public void Create_OnlyError_DataIsNull()
94+
{
95+
// arrange
96+
QueryError error = new QueryError("foo");
97+
98+
// act
99+
var result = new QueryResult(error);
100+
101+
// assert
102+
Assert.Null(result.Data);
103+
}
104+
}
105+
}

src/Core.Tests/Execution/SchemaDirectiveTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Threading.Tasks;
2+
using ChilliCream.Testing;
23
using HotChocolate.Types;
34
using Xunit;
45

0 commit comments

Comments
 (0)