Example #1
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());
        }
        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());
        }