Example #1
0
 private void TestDatasourceDataStore(BdoDatasourceDepot depot)
 {
     Assert.That(depot.HasItem("smtp_default"), "Error with item existence check");
     Assert.That(depot.Get("smtp_default")?.Configurations?.Count == 1, "Bad configuration count");
     Assert.That(depot.Get("smtp_default")?.Configurations[0]?.GetValue <string>("host") == _testData.host, "Bad string");
     Assert.That(depot.Get("smtp_default")?.Configurations[0]?.GetValue <int>("port") == _testData.port, "Bad integer");
     Assert.That(depot.Get("smtp_default")?.Configurations[0]?.GetValue <bool>("isDefaultCredentialsUsed") == _testData.isDefaultCredentialsUsed, "Bad boolean");
     Assert.That(depot.Get("smtp_default")?.Configurations[0]?.GetValue <bool>("isSslEnabled") == _testData.isSslEnabled, "Bad boolean");
     Assert.That(depot.Get("smtp_default")?.Configurations[0]?.GetValue <int>("timeout") == _testData.timeout, "Bad integer");
     Assert.That(depot.Get("smtp_default")?.Configurations[0]?.GetValue <string>("login") == _testData.login, "Bad string");
     Assert.That(depot.Get("smtp_default")?.Configurations[0]?.GetValue <string>("password") == _testData.password, "Bad string");
 }
Example #2
0
        public void CreateDatasourceDataStoreTest()
        {
            var config =
                BdoExtensionFactory.CreateConnectorConfiguration("messages$smtp")
                .WithItems(
                    ElementFactory.CreateScalar("host", _testData.host),
                    ElementFactory.CreateScalar("port", DataValueTypes.Integer, _testData.port),
                    ElementFactory.CreateScalar("isDefaultCredentialsUsed", DataValueTypes.Boolean, _testData.isDefaultCredentialsUsed),
                    ElementFactory.CreateScalar("isSslEnabled", DataValueTypes.Boolean, _testData.isSslEnabled),
                    ElementFactory.CreateScalar("timeout", DataValueTypes.Integer, _testData.timeout),
                    ElementFactory.CreateScalar("login", _testData.login),
                    ElementFactory.CreateScalar("password", _testData.password));

            _datasourceDepot = ItemFactory.CreateSet <BdoDatasourceDepot, IDatasource>(
                ItemFactory.CreateDatasource("smtp_default", DatasourceKind.EmailServer)
                .WithConfiguration(config));

            TestDatasourceDataStore(_datasourceDepot);
        }