コード例 #1
0
        public void Run_Given_ClassWithNoConcurrencyIssue_When_Calling_AsyncMethod_Should_ReturnWithNoIssues()
        {
            var instance = new ClassWithNoConcurrencyIssues();
            var finder   = new ConcurrencyChecker(instance);

            var report = finder.Run(5, async() => await instance.DoSomeWorkAndReturnResponseAsync(),
                                    async() => await instance.DoSomeWorkAndReturnResponseAsync());

            Console.WriteLine(report);

            Assert.IsNull(report);
        }
コード例 #2
0
        public void Run_Given_ClassWithNoConcurrencyIssue_When_Calling_AsyncMethod_Should_Succeed()
        {
            var instance = new ClassWithNoConcurrencyIssues();

            ConcurrencyChecker.AssertAsyncDeadlocksOnly(async() => await instance.DoSomeWorkAndReturnResponseAsync(), 200);
        }