Beispiel #1
0
        public void ProbeTest()
        {
            IProbeTaskFactory factory = _container.GetExportedValue <IProbeTaskFactory>();

            Task target = factory.Create(_probes[0]);

            Assert.IsNotNull(target);

            (target as IAsyncResult).AsyncWaitHandle.WaitOne();
            Assert.IsNotNull(target);
            Assert.IsInstanceOfType(target, typeof(Task <FindRequestContext>));
        }
Beispiel #2
0
        //-----------------------------------------------------
        //  Probe
        //-----------------------------------------------------

        #region Find

        /// <summary>
        /// Handles a find operation.
        /// </summary>
        /// <param name="findRequestContext">The find request context that describes the service to discover.</param>
        /// <param name="callback">The callback delegate to call when the operation is completed.</param>
        /// <param name="state">The user-defined state data.</param>
        /// <returns>A reference to the pending asynchronous operation.</returns>
        protected override IAsyncResult OnBeginFind(FindRequestContext findRequestContext, AsyncCallback callback, object state)
        {
            return(_findTaskFactory.Create(findRequestContext).ToApm(callback, state));
        }