Skip to content

Commit

Permalink
Include the signature of unsupported method in QueryTranslator exception
Browse files Browse the repository at this point in the history
  • Loading branch information
rosslovas committed Feb 2, 2023
1 parent c307a0f commit c6a9a23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions source/Nevermore.IntegrationTests/QueryableIntegrationFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1364,5 +1364,16 @@ public async Task ToListAsync()

customers.Select(c => c.LastName).Should().BeEquivalentTo("Apple");
}

[Test]
public async Task UnsupportedMethod_ShouldThrowNotSupportedException()
{
using var t = Store.BeginTransaction();

var runQueryWithUnsupportedMethod =
async () => _ = await t.Queryable<Customer>().Prepend(new()).ToListAsync();

await runQueryWithUnsupportedMethod.Should().ThrowAsync<NotSupportedException>();
}
}
}
2 changes: 1 addition & 1 deletion source/Nevermore/Advanced/Queryable/QueryTranslator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ protected override Expression VisitMethodCall(MethodCallExpression node)
return node;
}
default:
throw new NotSupportedException();
throw new NotSupportedException($"Specified method is not supported: {methodInfo}");
}
}

Expand Down

0 comments on commit c6a9a23

Please sign in to comment.