Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalSenn committed Oct 16, 2020
1 parent b902c2a commit 70a4741
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
Expand Up @@ -66,8 +66,8 @@ private async ValueTask ExecuteResolverPipelineAsync()

switch (_context.Result)
{
case IExecutable query:
_context.Result = await query.ExecuteAsync(_context.RequestAborted);
case IExecutable executable:
_context.Result = await executable.ExecuteAsync(_context.RequestAborted);
break;

case IQueryable queryable:
Expand Down
6 changes: 3 additions & 3 deletions src/HotChocolate/Core/test/Execution.Tests/CodeFirstTests.cs
Expand Up @@ -284,7 +284,7 @@ public string GetTest()
return "Hello World!";
}

public IQuery<string> GetQuery()
public IExecutable<string> GetQuery()
{
return MockQuery<string>.From("foo", "bar");
}
Expand Down Expand Up @@ -462,7 +462,7 @@ public class DogType
}
}

public class MockQuery<T> : IQuery<T>
public class MockQuery<T> : IExecutable<T>
{
private readonly IReadOnlyList<T> _list;

Expand All @@ -471,7 +471,7 @@ private MockQuery(IEnumerable<T> list)
_list = list.ToArray();
}

async ValueTask<object> IQuery.ExecuteAsync(CancellationToken cancellationToken)
async ValueTask<object> IExecutable.ExecuteAsync(CancellationToken cancellationToken)
{
return await ExecuteAsync(cancellationToken);
}
Expand Down
Expand Up @@ -301,7 +301,7 @@ public void IsEqual_Object_Byte_String_False()
[InlineData(typeof(IEnumerable<string>), "IEnumerable<String>", "String")]
[InlineData(typeof(IReadOnlyCollection<string>), "IReadOnlyCollection<String>", "String")]
[InlineData(typeof(IReadOnlyList<string>), "IReadOnlyList<String>", "String")]
[InlineData(typeof(IQuery<string>), "IQuery<String>", "String")]
[InlineData(typeof(IExecutable<string>), "IExecutable<String>", "String")]
[InlineData(typeof(string[]), "[String]", "String")]
[InlineData(
typeof(Task<IAsyncEnumerable<string>>),
Expand Down Expand Up @@ -329,7 +329,7 @@ public void SupportedListTypes(Type type, string listTypeName, string elementTyp
[InlineData(typeof(CustomStringList2<string>))]
[InlineData(typeof(ImmutableArray<string>))]
[InlineData(typeof(IEnumerable<string>))]
[InlineData(typeof(IQuery<string>))]
[InlineData(typeof(IExecutable<string>))]
[InlineData(typeof(Task<IAsyncEnumerable<string>>))]
[InlineData(typeof(ValueTask<IAsyncEnumerable<string>>))]
[Theory]
Expand Down Expand Up @@ -376,12 +376,12 @@ public void OptionalNullableOptionalNullableString()
}

[Fact]
public void From_IQueryScalar()
public void From_IExecutableScalar()
{
// arrange
// act
ExtendedType dict = ExtendedType.FromType(
typeof(IQuery<string>),
typeof(IExecutable<string>),
_cache);

// assert
Expand Down
16 changes: 8 additions & 8 deletions src/HotChocolate/Core/test/Types.Tests/Internal/TypeInfoTests.cs
Expand Up @@ -60,9 +60,9 @@ public class TypeInfoTests
[InlineData(typeof(IAsyncEnumerable<string>), "[String]")]
[InlineData(typeof(IEnumerable<string>), "[String]")]
[InlineData(typeof(IQueryable<string>), "[String]")]
[InlineData(typeof(IQuery<string>), "[String]")]
[InlineData(typeof(IQuery<int>), "[String!]")]
[InlineData(typeof(IQuery<int?>), "[String]")]
[InlineData(typeof(IExecutable<string>), "[String]")]
[InlineData(typeof(IExecutable<int>), "[String!]")]
[InlineData(typeof(IExecutable<int?>), "[String]")]
[Theory]
public void CreateTypeInfoFromRuntimeType(
Type clrType,
Expand All @@ -87,7 +87,7 @@ public class TypeInfoTests
[InlineData(typeof(IEnumerable<string>), "[String]")]
[InlineData(typeof(IReadOnlyCollection<string>), "[String]")]
[InlineData(typeof(IReadOnlyList<string>), "[String]")]
[InlineData(typeof(IQuery<string>), "[String]")]
[InlineData(typeof(IExecutable<string>), "[String]")]
[InlineData(typeof(string[]), "[String]")]
[Theory]
public void SupportedListTypes(Type clrType, string expectedTypeName)
Expand Down Expand Up @@ -597,13 +597,13 @@ public class Nullability

public ICollection<string>? NullableCollectionNonNullElement() => default;

public IQuery<string> NonNullQueryNonNullElement() => default!;
public IExecutable<string> NonNullQueryNonNullElement() => default!;

public IQuery<string?> NonNullQueryNullableElement() => default!;
public IExecutable<string?> NonNullQueryNullableElement() => default!;

public IQuery<string?>? NullableQueryNullableElement() => default;
public IExecutable<string?>? NullableQueryNullableElement() => default;

public IQuery<string>? NullableQueryNonNullElement() => default;
public IExecutable<string>? NullableQueryNonNullElement() => default;

public string[] NonNullArrayNonNullElement() => default!;

Expand Down

0 comments on commit 70a4741

Please sign in to comment.