Exemplo n.º 1
0
        public void Advices_InjectAfterAsyncMethod_WithResult()
        {
            AsyncTests.Data = false;
            Checker.Passed  = false;

            var a      = new AsyncTests_Target();
            var result = a.Do2().Result;

            Assert.Equal("test", result);
        }
Exemplo n.º 2
0
        public void Advices_InjectAfterAsyncMethod_WithArguments_And_Result()
        {
            AsyncTests.Data = false;
            Checker.Passed  = false;

            var a = new AsyncTests_Target();

            a.Do4("args_test").ConfigureAwait(false).GetAwaiter().GetResult();

            Assert.True(Checker.Passed);
        }
Exemplo n.º 3
0
        public void Advices_InjectAfterAsyncMethod()
        {
            AsyncTests.Data = false;
            Checker.Passed  = false;

            var a = new AsyncTests_Target();

            a.Do().Wait();

            Assert.True(Checker.Passed);
        }
Exemplo n.º 4
0
        public void Advices_InjectAfterAsyncMethod_Void()
        {
            AsyncTests.Data = false;
            Checker.Passed  = false;

            var a = new AsyncTests_Target();

            a.Do3();
            Task.Delay(200).Wait();

            Assert.IsTrue(Checker.Passed);
        }