Provides access to remote and local Catalogs. Handles downloading, signature verification and caching.
Наследование: ICatalogManager
        public void TestGetOnline()
        {
            var catalog = CatalogTest.CreateTestCatalog();

            catalog.Normalize();

            var catalogStream = new MemoryStream();

            catalog.SaveXml(catalogStream);
            var array = catalogStream.ToArray();

            catalogStream.Position = 0;

            using var server = new MicroServer("catalog.xml", catalogStream);
            var uri = new FeedUri(server.FileUri);

            CatalogManager.SetSources(new[] { uri });
            _trustManagerMock.Setup(x => x.CheckTrust(array, uri, null)).Returns(OpenPgpUtilsTest.TestSignature);

            _sut.GetOnline().Should().Be(catalog);
        }
 public void TestSetSources()
 {
     CatalogManager.SetSources(new[] { _testSource });
     CatalogManager.GetSources().Should().Equal(_testSource);
 }
 public void TestRemoveSourceMissing()
 {
     _sut.RemoveSource(_testSource).Should().BeFalse();
     CatalogManager.GetSources().Should().Equal(CatalogManager.DefaultSource);
 }
 public void TestRemoveSource()
 {
     _sut.RemoveSource(CatalogManager.DefaultSource).Should().BeTrue();
     CatalogManager.GetSources().Should().BeEmpty();
 }
 public void TestAddSourceNew()
 {
     _sut.AddSource(_testSource).Should().BeTrue();
     CatalogManager.GetSources().Should().Equal(CatalogManager.DefaultSource, _testSource);
 }
 public void TestAddSourceExisting()
 {
     _sut.AddSource(CatalogManager.DefaultSource).Should().BeFalse();
     CatalogManager.GetSources().Should().Equal(CatalogManager.DefaultSource);
 }