Esempio n. 1
0
        public void AsyncReactiveSubscriptionFactoryBase15_Create()
        {
            var s = new MyAsyncReactiveSubscriptionFactory <int, int, int, int, int, int, int, int, int, int, int, int, int, int, int>();

            var uri      = new Uri("bar://foo");
            var stateObj = new object();

            s.CreateAsyncImpl = (subscriptionUri, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, state, token) =>
            {
                Assert.AreEqual(uri, subscriptionUri);
                Assert.AreEqual(1, arg1);
                Assert.AreEqual(2, arg2);
                Assert.AreEqual(3, arg3);
                Assert.AreEqual(4, arg4);
                Assert.AreEqual(5, arg5);
                Assert.AreEqual(6, arg6);
                Assert.AreEqual(7, arg7);
                Assert.AreEqual(8, arg8);
                Assert.AreEqual(9, arg9);
                Assert.AreEqual(10, arg10);
                Assert.AreEqual(11, arg11);
                Assert.AreEqual(12, arg12);
                Assert.AreEqual(13, arg13);
                Assert.AreEqual(14, arg14);
                Assert.AreEqual(15, arg15);
                Assert.AreSame(stateObj, state);

                return(Task.FromResult <IAsyncReactiveSubscription>(null));
            };

            _ = s.CreateAsync(uri, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, stateObj).Result;
        }
Esempio n. 2
0
        public void AsyncReactiveSubscriptionFactoryBase2_Create()
        {
            var s = new MyAsyncReactiveSubscriptionFactory <int, int>();

            var uri      = new Uri("bar://foo");
            var stateObj = new object();

            s.CreateAsyncImpl = (subscriptionUri, arg1, arg2, state, token) =>
            {
                Assert.AreEqual(uri, subscriptionUri);
                Assert.AreEqual(1, arg1);
                Assert.AreEqual(2, arg2);
                Assert.AreSame(stateObj, state);

                return(Task.FromResult <IAsyncReactiveSubscription>(null));
            };

            _ = s.CreateAsync(uri, 1, 2, stateObj).Result;
        }
Esempio n. 3
0
        public void AsyncReactiveSubscriptionFactoryBase4_ArgumentChecking()
        {
            var s = new MyAsyncReactiveSubscriptionFactory <int, int, int, int>();

            Assert.ThrowsException <ArgumentNullException>(() => s.CreateAsync(null, 1, 2, 3, 4, new object()).Wait());
        }