public void AreFilesOutOfDate_LocalLessThan_Current()
        {
            PackageInstaller pkgInstaller = new PackageInstaller();
            IInstallSettings currentSettings = pkgInstaller.ReadInstallSettings(Consts.settingsXml01);
            string filePath = this.WriteTextToTempFile(Consts.settingsXml_Version05);
            bool result = pkgInstaller.AreExistingFilesOutOfDate(currentSettings, filePath);

            Assert.IsTrue(result);
        }
        public void TestGetInstallerSettingsFromResx()
        {
            IInstallSettings settings = new PackageInstaller().ReadInstallSettings();
            Assert.IsNotNull(settings);

            InstallSettings expected = new InstallSettings {
                Version = 1.4
            };
            expected.FilesToInstall.Add(new InstallFile(@"Install-Manifest.xml", "Install.Install-Manifest.xml", FileType.Text));
            expected.FilesToInstall.Add(new InstallFile(@"SlowCheetah.Transforms.targets", "Install.SlowCheetah.Transforms.targets", FileType.Text));
            expected.FilesToInstall.Add(new InstallFile(@"SlowCheetah.Tasks.dll", "Install.SlowCheetah.Tasks.dll", FileType.Binary));

            CustomAssert.AssertAreEqual(expected, settings);
        }
        public void InstallFilesTest01()
        {
            // TODO: delete files which reside in the install location locally

            try {
                PackageInstaller pkgInstaller = new PackageInstaller();

                IInstallSettings settings = pkgInstaller.ReadInstallSettings(Consts.settingsXml01);
                pkgInstaller.InstallFiles(settings);
            }
            catch (Exception ex) {
                throw ex;
            }
            // TODO: Some assertions here
        }
        public void TestGetInstallerSettingsFromXml()
        {
            IInstallSettings settings = new PackageInstaller().ReadInstallSettings(Consts.settingsXml01);
            Assert.IsNotNull(settings);

            InstallSettings expected = new InstallSettings {
                Version =1.0
            };
            expected.FilesToInstall.Add(new InstallFile (@"Install-Manifest.xml","Install.Install-Manifest.xml",FileType.Text));
            expected.FilesToInstall.Add(new InstallFile(@"SlowCheetah.Transforms.targets", "Install.SlowCheetah.Transforms.targets", FileType.Text));
            expected.FilesToInstall.Add(new InstallFile(@"Microsoft.Web.XmlTransform.dll", "Install.Microsoft.Web.XmlTransform.dll", FileType.Binary));
            expected.FilesToInstall.Add(new InstallFile(@"SlowCheetah.Xdt.dll", "Install.SlowCheetah.Xdt.dll", FileType.Binary));

            CustomAssert.AssertAreEqual(expected, settings);
        }
        public void TestReadInstallSettingsFromFile()
        {
            string filePath = this.WriteTextToTempFile(Consts.settingsXml01);
            IInstallSettings settings = new PackageInstaller().ReadInstallSettings(new FileInfo(filePath));

            InstallSettings expected = new InstallSettings {
                Version = 1.0
            };
            expected.FilesToInstall.Add(new InstallFile(@"Install-Manifest.xml", "Install.Install-Manifest.xml", FileType.Text));
            expected.FilesToInstall.Add(new InstallFile(@"SlowCheetah.Transforms.targets", "Install.SlowCheetah.Transforms.targets", FileType.Text));
            expected.FilesToInstall.Add(new InstallFile(@"Microsoft.Web.XmlTransform.dll", "Install.Microsoft.Web.XmlTransform.dll", FileType.Binary));
            expected.FilesToInstall.Add(new InstallFile(@"SlowCheetah.Xdt.dll", "Install.SlowCheetah.Xdt.dll", FileType.Binary));

            CustomAssert.AssertAreEqual(expected, settings);
        }