private PackageEntry(string id, string version, IReadOnlyList <FrameworkEntry> entries) { Fingerprint = CatalogExtensions.GetCatalogGuid(id, version); Id = id; Version = version; Entries = entries; }
public void CreateCompositionService_NullCatalog_ShouldThrowArgumentNullException() { Assert.Throws <ArgumentNullException>("composablePartCatalog", () => { CatalogExtensions.CreateCompositionService(null); }); }
public async Task VersionNotSpecifiedShaNotEqual() { var dependency = new Dependency(); dependency.Name = "FocLauncher.dll"; dependency.Destination = ApplicationBasePath; dependency.Sha2 = UpdaterUtilities.HexToArray("d32b568cd1b96d459e7291ebf4b25d007f275c9f13149beeb782fac0716613f8"); dependency.Origin = "https://example.com"; var component = CatalogExtensions.DependencyToComponent(dependency); const ComponentAction expected = ComponentAction.Update; await _updateManager.CalculateComponentStatusAsync(component); Assert.AreEqual(expected, component.RequiredAction); }
public async Task VersionHigher() { var dependency = new Dependency(); dependency.Name = "FocLauncher.dll"; dependency.Version = "2.0.0.0"; dependency.Destination = ApplicationBasePath; dependency.Origin = "https://example.com"; var component = CatalogExtensions.DependencyToComponent(dependency); const ComponentAction expected = ComponentAction.Update; await _updateManager.CalculateComponentStatusAsync(component); Assert.AreEqual(expected, component.RequiredAction); }
public async Task VersionEqualShaEqual() { var dependency = new Dependency(); dependency.Name = "FocLauncher.dll"; dependency.Version = "1.0.0.0"; dependency.Destination = ApplicationBasePath; dependency.Sha2 = UpdaterUtilities.GetFileHash(Path.Combine(ApplicationBasePath, dependency.Name), HashType.Sha256); dependency.Origin = "https://example.com"; var component = CatalogExtensions.DependencyToComponent(dependency); const ComponentAction expected = ComponentAction.Keep; await _updateManager.CalculateComponentStatusAsync(component); Assert.AreEqual(expected, component.RequiredAction); }