Пример #1
0
        public void TestThatSetApplicationConfigOverwritesExisting()
        {
            AppIdentity         appIdentity = new AppIdentity("app1", "1.0.0");
            AppDeploymentConfig config      = _deploymentConfig.GetApplicationConfig(appIdentity);

            config = config.AddProperty("key1", "value1");
            var deploymentConfig = _deploymentConfig.SetApplicationConfig(config);

            Assert.Equal("value1", deploymentConfig.GetApplicationConfig(appIdentity).Properties["key1"]);

            config           = config.AddProperty("key2", "value2");
            deploymentConfig = deploymentConfig.SetApplicationConfig(config);
            Assert.Equal("value1", deploymentConfig.GetApplicationConfig(appIdentity).Properties["key1"]);
            Assert.Equal("value2", deploymentConfig.GetApplicationConfig(appIdentity).Properties["key2"]);
        }
Пример #2
0
        public void TestSetApplicationConfig()
        {
            AppIdentity         appIdentity = new AppIdentity("newApp", "1.0.0");
            AppDeploymentConfig config      = new AppDeploymentConfig(appIdentity, new [] { "clusterId1" });

            config = config.AddProperty("Foo", "Bar");
            var deploymentConfig = _deploymentConfig.SetApplicationConfig(config);

            Assert.Equal("Bar", deploymentConfig.GetApplicationConfig(appIdentity).Properties["Foo"]);
        }