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)); } }
private void VerifyPostSharpDeployment(InstalledApplication app) { string sourceFolder = Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(typeof(InternalWatchdog).Assembly.CodeBase).Path)); foreach (string file in SharpRemoteFiles) { string sourceFileName = Path.Combine(sourceFolder, file); string destFileName = InternalWatchdog.Resolve(app, Environment.SpecialFolder.LocalApplicationData, file); ApplicationInstallerTest.FilesAreEqual(sourceFileName, destFileName) .Should().BeTrue(); } }
public void TestInstallSingleFile() { var descriptor = new ApplicationDescriptor { Name = "TestInstallSingleFile", }; string fullPath = InternalWatchdog.Resolve(descriptor.Name, Environment.SpecialFolder.CommonApplicationData, "SharpRemote.dll"); var original = new FileInfo(_sharpRemoteLibraryLocation); if (File.Exists(fullPath)) { File.Delete(fullPath); } InstalledApplication app; using (var installer = new ApplicationInstaller(_watchdog, descriptor)) { installer.AddFile(_sharpRemoteLibraryLocation, Environment.SpecialFolder.CommonApplicationData); app = installer.Commit(); } app.Descriptor.Should().Be(descriptor); app.Files.Count.Should().Be(1); InstalledFile file = app.Files[0]; file.Id.Should().Be(1); file.Folder.Should().Be(Environment.SpecialFolder.CommonApplicationData); file.Filename.Should().Be("SharpRemote.dll"); file.FileLength.Should().Be(original.Length); var copy = new FileInfo(fullPath); copy.Exists.Should().BeTrue("Because the file should've been created during the installation"); copy.Length.Should().Be(file.FileLength); FilesAreEqual(original, copy).Should().BeTrue(); }
public void TestCtor() { var watchdog = new InternalWatchdog(_storage.Object); }
public void SetUp() { //_silo = new InProcessRemotingSilo(); //_watchdog = _silo.CreateGrain<IInternalWatchdog>(typeof (internalWatchdog)); _watchdog = new InternalWatchdog(); }