private VariableDictionary AddEnvironmentVariables()
        {
            var variables  = new CalamariVariableDictionary();
            var convention = new ContributeEnvironmentVariablesConvention();

            convention.Install(new RunningDeployment("C:\\Package.nupkg", variables));

            Assert.That(variables.GetNames().Count, Is.GreaterThan(3));
            Assert.That(variables.GetRaw(SpecialVariables.Tentacle.Agent.InstanceName), Is.EqualTo("#{env:TentacleInstanceName}"));
            return(variables);
        }
示例#2
0
        public void ShouldAddEnvironmentVariables()
        {
            var variables  = new VariableDictionary();
            var convention = new ContributeEnvironmentVariablesConvention();

            convention.Install(new RunningDeployment("C:\\Package.nupkg", variables));

            Assert.That(variables.GetNames().Count, Is.GreaterThan(3));
            Assert.That(variables.Evaluate("My OS is #{env:OS}"), Is.StringStarting("My OS is Windows"));
            Assert.That(variables.GetRaw(SpecialVariables.Tentacle.Agent.InstanceName), Is.EqualTo("#{env:TentacleInstanceName}"));
        }