Beispiel #1
0
        public void TestGettingConnectorSettingsFromString()
        {
            var settings = SCLSettings.CreateFromString(ConnectorJson);

            var connectorSettings = ConnectorSettings.CreateFromSCLSettings(settings).ToList();

            connectorSettings.Should().HaveCount(1);

            var nuixSettings = connectorSettings.Single().Settings;

            nuixSettings.Id.Should().Be("Reductech.EDR.Nuix");
            nuixSettings.Version.Should().Be("0.9.0");
            nuixSettings.Enable.Should().Be(true);

            nuixSettings.Settings.TryGetNestedBool("UseDongle").Should().BeTrue();
        }
Beispiel #2
0
        public void TestCreatingSettingsFromString()
        {
            var settings = SCLSettings.CreateFromString(ConnectorJson);

            TestOutputHelper.WriteLine(settings.ToString());

            settings.Entity.TryGetNestedEntity("Connectors")
            .Value
            .TryGetNestedEntity("Nuix")
            .Value
            .TryGetNestedEntity("Settings")
            .Value
            .TryGetValue("UseDongle")
            .Value.GetPrimitiveString()
            .Should()
            .Be(true.ToString());

            var udString = settings.Entity.TryGetNestedString(
                "Connectors",
                "Nuix",
                "Settings",
                "UseDongle"
                );

            udString.HasValue.Should().BeTrue();
            udString.Value.Should().Be(true.ToString());

            var udBool = settings.Entity.TryGetNestedBool(
                "Connectors",
                "Nuix",
                "Settings",
                "UseDongle"
                );

            udBool.Should().BeTrue();

            var featuresList = settings.Entity.TryGetNestedList(
                "Connectors",
                "Nuix",
                "Settings",
                "Features"
                );

            featuresList.HasValue.Should().BeTrue();

            featuresList.Value.Should()
            .BeEquivalentTo(
                "ANALYSIS",
                "CASE_CREATION",
                "EXPORT_ITEMS",
                "METADATA_IMPORT",
                "OCR_PROCESSING",
                "PRODUCTION_SET"
                );

            var consoleArgsList = settings.Entity.TryGetNestedList(
                "Connectors",
                "Nuix",
                "Settings",
                "ConsoleArguments"
                );

            consoleArgsList.HasValue.Should().BeTrue();

            consoleArgsList.Value.Should()
            .BeEquivalentTo(
                "-Dnuix.licence.handlers=server",
                "-Dnuix.registry.servers=licenseSource"
                );

            var username = settings.Entity.TryGetNestedString(
                "Connectors",
                "Nuix",
                "Settings",
                "EnvironmentVariables",
                "NUIX_USERNAME"
                );

            username.HasValue.Should().BeTrue();

            username.Value.Should().BeEquivalentTo("myName");
        }