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(); } }
public void HAExtenderGetConfTest() { Ksi ksi = new Ksi(new HAKsiService(null, ExtendingServices, null)); ExtenderConfig conf = ksi.GetExtenderConfig(); Assert.NotNull(conf); }
public void TcpGetExtenderConfigSuccessWithInvalidSigningPortTest(Ksi ksi) { Assert.DoesNotThrow(delegate { ksi.GetExtenderConfig(); }, "Invalid signing port should not prevent getting extender config."); }
public void GetExtenderConfigSuccessWithInvalidSigningPassTest(Ksi ksi) { if (TestSetup.PduVersion != PduVersion.v1) { Assert.DoesNotThrow(delegate { ksi.GetExtenderConfig(); }, "Invalid signing password should not prevent getting extender config."); } }
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"); }
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"); }
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); }
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); }
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); } }