Пример #1
0
 public void Init()
 {
     data               = Substitute.For <IUpdateServerDataProvider>();
     clientFactory      = Substitute.For <IUpdateClientFactory>();
     applicationVersion = Substitute.For <IApplicationVersion>();
     application        = Substitute.For <IApplication>();
     fileSystem         = Substitute.For <IFileSystem>();
     standaloneUpdate   = Substitute.For <IStandaloneUpdater>();
     updateClient       = Substitute.For <IUpdateClient>();
     settings           = Substitute.For <IUpdaterSettingsProvider>();
     platformService    = Substitute.For <IAutoUpdatePlatformService>();
     updateVerifier     = Substitute.For <IUpdateVerifier>();
     clientFactory
     .Create(Arg.Any <Uri>(), Arg.Any <string>(), Arg.Any <string?>(), Arg.Any <Platforms>())
     .Returns(updateClient);
 }
Пример #2
0
 public UpdateService(IUpdateServerDataProvider data,
                      IUpdateClientFactory clientFactory,
                      IApplicationVersion applicationVersion,
                      IApplication application,
                      IFileSystem fileSystem,
                      IStandaloneUpdater standaloneUpdater,
                      IUpdaterSettingsProvider settings,
                      IAutoUpdatePlatformService platformService,
                      IUpdateVerifier updateVerifier)
 {
     this.data               = data;
     this.clientFactory      = clientFactory;
     this.applicationVersion = applicationVersion;
     this.application        = application;
     this.fileSystem         = fileSystem;
     this.standaloneUpdater  = standaloneUpdater;
     this.settings           = settings;
     this.platformService    = platformService;
     this.updateVerifier     = updateVerifier;
     standaloneUpdater.RenameIfNeeded();
 }