Exemplo n.º 1
0
        public async Task VerifyCancelation()
        {
            if (!this.UpdateFileSystem.TemporaryPath.Exists)
            {
                this.UpdateFileSystem.TemporaryPath.Create();
                this.UpdateFileSystem.TemporaryPath.Refresh();
            }

            this.SetupTestContentForInstallationCancellationPurpose(this.UpdateFileSystem.TemporaryPath.FullName);

            var viewModel = new PluginRowViewModel(this.Plugin, this.UpdateFileSystem);
            await viewModel.HandlingCancelationOfInstallation();

            this.AssertInstalledTestFileHasBeenRestored();
        }
Exemplo n.º 2
0
        public async Task VerifyInstallation()
        {
            var viewModel = new PluginRowViewModel(this.Plugin, this.UpdateFileSystem);

            await viewModel.Install(new CancellationToken(false));

            Assert.IsTrue(new DirectoryInfo(this.InstallPath).Exists);

            var filesEnumeration = this.UpdateFileSystem.InstallationPath.EnumerateFiles("*", SearchOption.AllDirectories);

            Assert.AreEqual(5, filesEnumeration.Count());

            var newVersionManifest = JsonConvert.DeserializeObject <Manifest>(File.ReadAllText(Path.Combine(this.UpdateFileSystem.InstallationPath.FullName, "CDP4BasicRdl.plugin.manifest")));

            Assert.AreEqual(new Version("5.5.5.5"), new Version(newVersionManifest.Version));
            Assert.AreEqual(this.Manifest.Description, newVersionManifest.Description);
            Thread.Sleep(1);
        }
Exemplo n.º 3
0
        public void VerifyProperties()
        {
            var viewModel = new PluginRowViewModel(this.Plugin);

            Assert.AreEqual(viewModel.Name, this.Manifest.Name);
            Assert.AreEqual(viewModel.Version, $"Version {this.Manifest.Version}");
            Assert.AreEqual(viewModel.Description, this.Manifest.Description);
            Assert.AreEqual(viewModel.Author, this.Manifest.Author);
            Assert.AreEqual(viewModel.ReleaseNote, this.Manifest.ReleaseNote);
            Assert.AreEqual(viewModel.Progress, 0);

            Assert.IsNotNull(viewModel.FileSystem.UpdateCdp4CkFileInfo);

            Assert.IsNotNull(viewModel.FileSystem.InstallationPath);

            Assert.IsNotNull(viewModel.FileSystem.TemporaryPath);
            Assert.IsTrue(viewModel.FileSystem.TemporaryPath.FullName.Contains("Temp"));
        }