Пример #1
0
        public static async void TestAsyncConditionalExpression4()
        {
            var done = Assert.Async();

            var c         = new Bridge2689();
            var condition = true;

            var result = condition ? await c.GetStr("1") : await c.ShouldNotBeInvokedAsync <string>("2");

            Assert.AreEqual("1", result);

            done();
        }
Пример #2
0
        public static async void TestAsyncConditionalExpression1()
        {
            var done = Assert.Async();

            var c         = new Bridge2689();
            var condition = false;

            var result = condition ? c.ShouldNotBeInvoked <string>("1") : (await c.GetStr("2")).ToString();

            Assert.AreEqual("2", result);

            done();
        }
Пример #3
0
        public static async void TestAsyncBinaryExpression10()
        {
            var done = Assert.Async();

            var c = new Bridge2689();

            var result = await c.GetBool("1", true) && await c.GetBool("2", true) || await c.GetBool("3", false);

            Assert.True(result);
            Assert.AreEqual("12", c.tracker.ToString());

            done();
        }
Пример #4
0
        public static async void TestAsyncBinaryExpression5()
        {
            var done = Assert.Async();

            var c = new Bridge2689();

            var result = await c.GetBool("1", false) || (await c.GetBool("2", true) ? await c.GetBool("3", true) : await c.ShouldNotBeInvokedAsync <bool>("4"));

            Assert.True(result);
            Assert.AreEqual("123", c.tracker.ToString());

            done();
        }
Пример #5
0
        public static async void TestAsyncConditionalExpression10()
        {
            var done = Assert.Async();

            var c = new Bridge2689();

            var result = await c.GetBool("1", true) ? await c.GetStr("2") : await c.ShouldNotBeInvokedAsync <string>("3");

            Assert.AreEqual("2", result);
            Assert.AreEqual("12", c.tracker.ToString());

            done();
        }
Пример #6
0
        public static async void TestAsyncConditionalExpression7()
        {
            var done = Assert.Async();

            var c         = new Bridge2689();
            var condition = true;

            var result = condition ? await c.GetStr("2", await c.GetStr("3", await c.GetStr("4"))) : c.ShouldNotBeInvoked <string>("1");

            Assert.AreEqual("4", result);
            Assert.AreEqual("432", c.tracker.ToString());

            done();
        }