Пример #1
0
        public void TestInstallMultipleFiles()
        {
            var descriptor = new ApplicationDescriptor
            {
                Name = "TestInstallSingleFile",
            };

            InstalledApplication app;

            using (var installer = new ApplicationInstaller(_watchdog, descriptor))
            {
                installer.AddFiles(_binFolder, Environment.SpecialFolder.CommonDocuments);
                app = installer.Commit();
            }

            string[]             expectedFiles = Directory.GetFiles(_binFolder);
            List <InstalledFile> actualFiles   = app.Files;

            actualFiles.Count.Should().Be(expectedFiles.Length);
            for (int i = 0; i < expectedFiles.Length; ++i)
            {
                string fullPath = InternalWatchdog.Resolve(descriptor.Name, Environment.SpecialFolder.CommonDocuments,
                                                           actualFiles[i].Filename);
                FilesAreEqual(new FileInfo(expectedFiles[i]), new FileInfo(fullPath));
            }
        }