コード例 #1
0
        public void CodeAwaitExpression_ConfigureAwait_NullExpression()
        {
            var expression           = new AwaitExpression();
            var configuredExpression = expression.ConfigureAwait(continueOnCapturedContext: true);

            Assert.Equal(expression, configuredExpression);
            Assert.Null(configuredExpression.Expression);
        }
コード例 #2
0
        public void CodeAwaitExpression_ConfigureAwait()
        {
            var expression           = new AwaitExpression(new SnippetExpression("test"));
            var configuredExpression = expression.ConfigureAwait(continueOnCapturedContext: true);

            Assert.Equal(expression, configuredExpression);
            Assert.Equal(true, configuredExpression.Expression.As <MethodInvokeExpression>().Arguments[0].As <LiteralExpression>().Value);
        }
コード例 #3
0
        public void CodeAwaitExpression_ConfigureAwait_NullExpression()
        {
            var expression           = new AwaitExpression();
            var configuredExpression = expression.ConfigureAwait(true);

            Assert.AreEqual(expression, configuredExpression);
            Assert.AreEqual(null, configuredExpression.Expression);
        }