Esempio n. 1
0
 //public IManageGeneralSequence Sequence { get { return _localSequence; } }
 public IOfferLocalOperations TransformConfigFile(string configDirPath, string configName, string transformName)
 {
     var operation = new TransformConfigOperation(configDirPath, configName,
                                                                             transformName);
     _localSequence.Add(operation);
     return this;
 }
Esempio n. 2
0
        public void TestThatTransformConfigOperationCorrectlyTransformsConfigFile()
        {
            var source = WriteTextToTempFile(Consts.Source01);
            var transform = WriteTextToTempFile(Consts.Transform01);
            var destination = source;
            var expectedResultFile = WriteTextToTempFile(Consts.Result01);

            var trans = new TransformConfigOperation(Path.GetDirectoryName(source), Path.GetFileName(source), Path.GetFileName(transform));
            var webDepStatus = new WebDeploymentStatus();
            trans.Execute(webDepStatus, new ConDepConfig(), new ConDepOptions(false, "", false, false, false, false, null));

            Assert.That(webDepStatus.HasErrors, Is.False);

            var actualResult = File.ReadAllText(destination);
            var expectedResult = File.ReadAllText(expectedResultFile);
            Assert.AreEqual(expectedResult.Trim(), actualResult.Trim());
        }
 /// <summary>
 /// Transforms .NET configuration files (web and app config), in exactly the same way as msbuild and Visual Studio does.
 /// </summary>
 /// <param name="configDirPath"></param>
 /// <param name="configName"></param>
 /// <param name="transformName"></param>
 /// <returns></returns>
 public static IOfferLocalOperations TransformConfigFile(this IOfferLocalOperations local, string configDirPath, string configName, string transformName)
 {
     var operation = new TransformConfigOperation(configDirPath, configName, transformName);
     Configure.Operation(local, operation);
     return local;
 }
        public void TestThatTransformConfigOperationCorrectlyTransformsConfigFile()
        {
            var source = WriteTextToTempFile(Consts.Source01);
            var transform = WriteTextToTempFile(Consts.Transform01);
            var destination = source;
            var expectedResultFile = WriteTextToTempFile(Consts.Result01);

            var trans = new TransformConfigOperation(Path.GetDirectoryName(source), Path.GetFileName(source), Path.GetFileName(transform));
            var webDepStatus = new StatusReporter();
            trans.Execute(webDepStatus, _settingsDefault, _token);

            //Assert.That(webDepStatus.HasErrors, Is.False);

            var actualResult = File.ReadAllText(destination);
            var expectedResult = File.ReadAllText(expectedResultFile);
            Assert.AreEqual(expectedResult.Trim(), actualResult.Trim());
        }