Skip to content

Commit

Permalink
Merge pull request #40 from Concurrency-Lab/ph-s031-refine-unit-tests
Browse files Browse the repository at this point in the history
Added unit test for unresolvable Task.Run delegates.
  • Loading branch information
camrein authored Sep 16, 2020
2 parents 0113ea2 + 72fa4e2 commit da29035
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,24 @@ public async Task DoItAsync() {
};
action();
}
}";
VerifyDiagnostic(source);
}

[TestMethod]
public void DoesNotReportMonitorWaitWhenTaskRunDelegateIsUnresolvable() {
const string source = @"
using System;
using System.Threading.Tasks;
class Test {
private readonly object syncObject = new object();
private Action action;
public async Task DoItAsync() {
Task.Run(action);
}
}";
VerifyDiagnostic(source);
}
Expand Down

0 comments on commit da29035

Please sign in to comment.