示例#1
0
        protected override DeploymentStepStatus DoExecute()
        {
            if (Parameters.Profile.WebConfigSettings.Skip)
            {
                SetStatusSkipped();
                return(Status);
            }
            var configValues = _reader.GetValues(Parameters.NewWebConfigPath);

            _replacer.ReplaceIn(Path.Combine(Parameters.DestinationFolder, WebConfigName));
            return(Status);
        }
示例#2
0
        public void ShouldReadConfigValues()
        {
            var lines = new[]
            {
                "key1=value1",
                "key2=\"value2\""
            };

            using (_mockRepository.Record())
            {
                SetupResult.For(_fileReaderMock.ReadLines(SomeConfigFilePath)).Return(lines);
            }
            using (_mockRepository.Playback())
            {
                var dictionary = _configValuesReader.GetValues(SomeConfigFilePath);
                Assert.That(dictionary.Count, Is.EqualTo(2));
                Assert.That(dictionary["key1"], Is.EqualTo("value1"));
                Assert.That(dictionary["key2"], Is.EqualTo("\"value2\""));
            }
        }