private void Test(ConnectorFake connector) { Assert.That(connector != null, "Connector missing"); if (connector != null) { Assert.That(connector.Host == _testData.host, "Bad connector"); Assert.That(connector.Port == _testData.port, "Bad connector"); Assert.That(connector.IsSslEnabled == _testData.isSslEnabled, "Bad connector"); } }
public void CreateConnectorTest() { IBdoConnectorConfiguration config = GlobalVariables.Scope.CreateConnectorConfiguration("tests.core$testConnector") .WithItems( ElementFactory.CreateScalar("host", _testData.host), ElementFactory.CreateScalar("port", _testData.port), ElementFactory.CreateScalar("isSslEnabled", _testData.isSslEnabled)); _connector = GlobalVariables.Scope.CreateConnector <ConnectorFake>(config, "connector"); Test(_connector); }
public void LoadConfigurationTest() { var log = new BdoLog(); if (_connector == null || !File.Exists(_filePath)) { SaveConnectorTest(); } string xml = string.Empty; BdoConnectorConfiguration configuration = XmlHelper.Load <BdoConnectorConfiguration>(_filePath, log: log); ConnectorFake connector = GlobalVariables.Scope.CreateConnector <ConnectorFake>(configuration, null, log); if (log.HasErrorsOrExceptions()) { xml = ". Result was '" + log.ToXml() + "'"; } Assert.That(!log.HasErrorsOrExceptions(), "Connector loading failed" + xml); Test(connector); }