-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Hi,
I'm working with Azure.Data.Tables nuget package and while i'm trying to call an async method on an internal class a RuntimeBinderException is thrown.
Here is a test that highlights this error.
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Azure.Data.Tables.Models;
using Dynamitey;
using NUnit.Framework;
namespace Azure.Data.Tables.WithDynamitey.Tests
{
public class WhereAsyncShould
{
[Test]
public async Task Failing()
{
string tableName = "WhereAsyncShould";
var serviceClient = new TableServiceClient("UseDevelopmentStorage=true");
var client = serviceClient.GetTableClient(tableName);
var restClient = Dynamic.InvokeGet(client, "_tableOperations");
var response = await Dynamic.InvokeMember(restClient, new InvokeMemberName("QueryEntitiesAsync", false), new object[]
{
new InvokeArg("table", tableName),
new InvokeArg("timeout", (int?)10),
new InvokeArg("queryOptions", BuildQueryOptions(client)),
new InvokeArg("cancellationToken", CancellationToken.None)
});
Assert.That(response, Is.Not.Null);
}
private static dynamic BuildQueryOptions(TableClient tableClient)
{
var t = typeof(TableItem).Assembly.GetType("Azure.Data.Tables.Models.QueryOptions");
var opts = Dynamic.InvokeConstructor(t);
Dynamic.InvokeSet(opts, "Format", Dynamic.InvokeGetChain(tableClient, "_defaultQueryOptions.Format"));
return opts;
}
}Any help would be appreciated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels