tumtumtum / Shaolinq

ORM for .NET with full LINQ support for Postgres, Sqlite, MySql and SqlServer
Other
127 stars 19 forks source link

Add test case for picking up Async methods declared in base classes or interfaces #83

Closed samcook closed 7 years ago

samcook commented 7 years ago

Currently not picking up async methods declared in base classes or interfaces

private IThing iThing;
private Thing thing;
private Widget widget;

[RewriteAsync]
public void Foo()
{
    iThing.DoSomethingNested();
    iThing.DoSomethingNotNested();

    thing.DoSomethingNested();
    thing.DoSomethingNotNested();

    widget.DoSomethingNested();
    widget.DoSomethingNotNested();
}

becomes

public async Task FooAsync(CancellationToken cancellationToken)
{
    iThing.DoSomethingNested(); // should be async
    await iThing.DoSomethingNotNestedAsync().ConfigureAwait(false);
    await thing.DoSomethingNestedAsync().ConfigureAwait(false);
    await thing.DoSomethingNotNestedAsync().ConfigureAwait(false);
    widget.DoSomethingNested(); // should be async
    await widget.DoSomethingNotNestedAsync().ConfigureAwait(false);
}