public void AsyncGetAggregatorConfigTest(KsiService service)
        {
            if (TestSetup.PduVersion == PduVersion.v1)
            {
                return;
            }

            ManualResetEvent waitHandle     = new ManualResetEvent(false);
            AggregatorConfig config         = null;
            object           testObject     = new object();
            bool             isAsyncCorrect = false;

            service.BeginGetAggregatorConfig(delegate(IAsyncResult ar)
            {
                try
                {
                    isAsyncCorrect = ar.AsyncState == testObject;
                    config         = service.EndGetAggregatorConfig(ar);
                }
                finally
                {
                    waitHandle.Set();
                }
            }, testObject);

            Assert.IsTrue(waitHandle.WaitOne(10000), "Wait handle timed out.");

            Assert.IsNotNull(config, "Aggregator configuration should not be null.");
            Assert.AreEqual(true, isAsyncCorrect, "Unexpected async state.");
        }
        public void EndGetAggregatorConfigWithoutSigningServiceProtocol()
        {
            KsiService service = new KsiService(null, null, null, null, null, null);

            KsiServiceException ex = Assert.Throws <KsiServiceException>(delegate
            {
                service.EndGetAggregatorConfig(new TestAsyncResult());
            });

            Assert.That(ex.Message.StartsWith("Signing service protocol is missing from service"), "Unexpected exception message: " + ex.Message);
        }