コード例 #1
0
        public void GetExtenderConfigTest(Ksi ksi)
        {
            if (TestSetup.PduVersion == PduVersion.v1)
            {
                Exception ex = Assert.Throws <KsiServiceException>(delegate
                {
                    ksi.GetExtenderConfig();
                });

                Assert.That(ex.Message.StartsWith("Extender config request is not supported using PDU version v1"), "Unexpected exception message: " + ex.Message);
            }
            else
            {
                ksi.GetExtenderConfig();
            }
        }
コード例 #2
0
ファイル: HATests.cs プロジェクト: betosmith2000/ksi-net-sdk
        public void HAExtenderGetConfTest()
        {
            Ksi            ksi  = new Ksi(new HAKsiService(null, ExtendingServices, null));
            ExtenderConfig conf = ksi.GetExtenderConfig();

            Assert.NotNull(conf);
        }
コード例 #3
0
 public void TcpGetExtenderConfigSuccessWithInvalidSigningPortTest(Ksi ksi)
 {
     Assert.DoesNotThrow(delegate
     {
         ksi.GetExtenderConfig();
     }, "Invalid signing port should not prevent getting extender config.");
 }
コード例 #4
0
 public void GetExtenderConfigSuccessWithInvalidSigningPassTest(Ksi ksi)
 {
     if (TestSetup.PduVersion != PduVersion.v1)
     {
         Assert.DoesNotThrow(delegate
         {
             ksi.GetExtenderConfig();
         }, "Invalid signing password should not prevent getting extender config.");
     }
 }
コード例 #5
0
        public void ExtenderConfigRequestStaticTest()
        {
            Ksi ksi = GetStaticKsi(Resources.KsiService_ExtenderConfigResponsePdu);

            ExtenderConfig config = ksi.GetExtenderConfig();

            Assert.AreEqual(273, config.MaxRequests, "Unexpected max requests value");
            Assert.AreEqual(1455478441, config.CalendarFirstTime, "Unexpected calendar first time value");
            Assert.AreEqual(1455478442, config.CalendarLastTime, "Unexpected calendar last time value");
        }
コード例 #6
0
        public void ExtenderConfigRequestWithMultiPayloadsResponseStaticTest()
        {
            // Response has multiple payloads (2 extending payloads and a configuration payload)
            Ksi ksi = GetStaticKsi(Resources.KsiService_ExtendResponsePdu_Multi_Payloads);

            ExtenderConfig config = ksi.GetExtenderConfig();

            Assert.AreEqual(273, config.MaxRequests, "Unexpected max requests value");
            Assert.AreEqual(1455478441, config.CalendarFirstTime, "Unexpected calendar first time value");
            Assert.AreEqual(1455478442, config.CalendarLastTime, "Unexpected calendar last time value");
        }
コード例 #7
0
        public void TcpGetExtenderConfigWithInvalidPortTest(Ksi ksi)
        {
            Exception ex = Assert.Throws <KsiServiceProtocolException>(delegate
            {
                ksi.GetExtenderConfig();
            });

            Assert.That(ex.Message.StartsWith("Completing connection failed"), "Unexpected exception message: " + ex.Message);
            Assert.IsNotNull(ex.InnerException, "Inner exception should not be null");
            Assert.That(ex.InnerException.Message.StartsWith("No connection could be made because the target machine actively refused it"),
                        "Unexpected inner exception message: " + ex.InnerException.Message);
        }
コード例 #8
0
        public void ExtenderConfigRequestInvalidStaticTest()
        {
            // pdu does not contain extender config payload
            Ksi ksi = GetStaticKsi(Resources.KsiService_ExtendResponsePdu_RequestId_1043101455);

            KsiServiceException ex = Assert.Throws <KsiServiceException>(delegate
            {
                ksi.GetExtenderConfig();
            });

            Assert.That(ex.Message.StartsWith("Invalid response PDU. Could not find a valid payload."), "Unexpected exception message: " + ex.Message);
        }
コード例 #9
0
        public void HttpGetExtenderConfigWithInvalidUrlTest(Ksi ksi)
        {
            if (TestSetup.PduVersion == PduVersion.v1)
            {
                Exception ex = Assert.Throws <KsiServiceException>(delegate
                {
                    ksi.GetExtenderConfig();
                });

                Assert.That(ex.Message.StartsWith("Extender config request is not supported using PDU version v1"), "Unexpected exception message: " + ex.Message);
            }

            else
            {
                Exception ex = Assert.Throws <KsiServiceProtocolException>(delegate
                {
                    ksi.GetExtenderConfig();
                });

                Assert.That(ex.Message.StartsWith("Request failed"), "Unexpected exception message: " + ex.Message);
                Assert.That(ex.InnerException.Message.StartsWith("The remote name could not be resolved"), "Unexpected inner exception message: " + ex.InnerException.Message);
            }
        }