Пример #1
0
        public AppUpdates(IAppUpdateConfig config, ILaunchableFile launchableFile)
        {
            Ensure.NotNull(config, nameof(config));

            config.Validate();

            _releaseStorage =
                new OrderedReleaseStorage(
                    new SafeReleaseStorage(
                        new WebReleaseStorage(config)));

            _updatesDirectory =
                new SafeUpdatesDirectory(
                    new UpdatesDirectory(config.UpdatesPath, config.CurrentVersion)
                    );

            _fileLocation = new FileLocation(_updatesDirectory.Path);

            _downloadable =
                new SafeDownloadableFile(
                    new DownloadableFile(config.HttpClient));

            _validatable =
                new SafeValidatableFile(
                    new CachingValidatableFile(
                        new ValidatableFile()));

            _launchable = new SafeLaunchableFile(launchableFile);
        }
Пример #2
0
 public SafeDownloadableFile(IDownloadableFile origin)
 {
     _origin = origin;
 }
Пример #3
0
 public static void PushToBrowser(IDownloadableFile file)
 {
     PushToBrowser(file.ContentType, file.DownloadAsFilename, file.GetContent());
 }
Пример #4
0
 public void TestInitialize()
 {
     _origin = Substitute.For <IDownloadableFile>();
 }