public void ShouldNotRunIfVariableNotSet()
        {
            var convention = new ConfigurationVariablesConvention(fileSystem, replacer);

            convention.Install(deployment);
            replacer.DidNotReceiveWithAnyArgs().ModifyConfigurationFile(null, null);
        }
예제 #2
0
        public void ShouldNotRunIfFeatureNotEnabled()
        {
            var convention = new ConfigurationVariablesConvention(new ConfigurationVariablesBehaviour(fileSystem, deployment.Variables, replacer, new InMemoryLog()));

            convention.Install(deployment);
            replacer.DidNotReceiveWithAnyArgs().ModifyConfigurationFile(null, null);
        }
예제 #3
0
        public void ShouldNotRunIfConfiguredToNotReplace()
        {
            deployment.Variables.Set(KnownVariables.Package.EnabledFeatures, KnownVariables.Features.ConfigurationVariables);
            deployment.Variables.Set(KnownVariables.Package.AutomaticallyUpdateAppSettingsAndConnectionStrings, "false");
            var convention = new ConfigurationVariablesConvention(new ConfigurationVariablesBehaviour(fileSystem, deployment.Variables, replacer, new InMemoryLog()));

            convention.Install(deployment);
            replacer.DidNotReceiveWithAnyArgs().ModifyConfigurationFile(null, null);
        }
        public void ShouldFindAndCallDeployScripts()
        {
            deployment.Variables.Set(SpecialVariables.Package.AutomaticallyUpdateAppSettingsAndConnectionStrings, "true");
            var convention = new ConfigurationVariablesConvention(fileSystem, replacer);

            convention.Install(deployment);
            replacer.Received().ModifyConfigurationFile("C:\\App\\MyApp\\Web.config", deployment.Variables);
            replacer.Received().ModifyConfigurationFile("C:\\App\\MyApp\\Web.Release.config", deployment.Variables);
            replacer.Received().ModifyConfigurationFile("C:\\App\\MyApp\\Views\\Web.config", deployment.Variables);
        }
예제 #5
0
        public void ShouldFindAndCallDeployScripts()
        {
            deployment.Variables.Set(KnownVariables.Package.EnabledFeatures, KnownVariables.Features.ConfigurationVariables);
            var convention = new ConfigurationVariablesConvention(new ConfigurationVariablesBehaviour(fileSystem, replacer, new InMemoryLog()));

            convention.Install(deployment);
            replacer.Received().ModifyConfigurationFile("C:\\App\\MyApp\\Web.config", deployment.Variables);
            replacer.Received().ModifyConfigurationFile("C:\\App\\MyApp\\Web.Release.config", deployment.Variables);
            replacer.Received().ModifyConfigurationFile("C:\\App\\MyApp\\Views\\Web.config", deployment.Variables);
        }