コード例 #1
0
        [Fact] // Ensures valid feeds are correctly imported.
        public void Import()
        {
            var feed = FeedTest.CreateTestFeed();
            var data = SignFeed(feed);

            // No previous feed
            _feedCacheMock.Setup(x => x.GetSignatures(feed.Uri)).Throws <KeyNotFoundException>();

            _feedCacheMock.Setup(x => x.Add(feed.Uri, data));
            using var feedFile = new TemporaryFile("0install-unit-tests");
            File.WriteAllBytes(feedFile, data);
            _feedManager.ImportFeed(feedFile);
        }