コード例 #1
0
        public async Task TestThrowInSubTask()
        {
            var obj   = new ThrowExceptionTester();
            var proxy = ProxyGenerator.CreateClassProxy <ThrowExceptionTester>();

            Assert.True(proxy.IsProxy());

            await AssertSameThrowsAsync(
                async() => await obj.ThrowInSubTask(),
                async() => await proxy.ThrowInSubTask());
        }
コード例 #2
0
        public async Task TestThrowInUncontinuedTasks()
        {
            var obj   = new ThrowExceptionTester();
            var proxy = ProxyGenerator.CreateClassProxy <ThrowExceptionTester>();

            Assert.True(proxy.IsProxy());

            // todo re-test
            // await AssertSameThrowsAsync(
            //     async () => await obj.ThrowInUncontinuedTasks(),
            //     async () => await proxy.ThrowInUncontinuedTasks());
        }
コード例 #3
0
        public async Task TestThrowException()
        {
            var obj   = new ThrowExceptionTester();
            var proxy = ProxyGenerator.CreateClassProxy <ThrowExceptionTester>();

            Assert.True(proxy.IsProxy());

            AssertSameThrows(
                () => obj.ThrowOfResult(),
                () => proxy.ThrowOfResult());

            await AssertSameThrowsAsync(
                async() => await obj.ThrowAsyncOfTaskResult(),
                async() => await proxy.ThrowAsyncOfTaskResult());

            await AssertSameThrowsAsync(
                async() => await obj.ThrowAsyncOfValueTask(),
                async() => await proxy.ThrowAsyncOfValueTask());
        }