public virtual void Setup() { this.Tracer = new MockTracer(); this.Output = new MockTextWriter(); this.PrerunChecker = new MockInstallerPrerunChecker(this.Tracer); this.LocalConfig = new MockLocalGVFSConfig(); this.Upgrader = new MockGitHubUpgrader( LocalGVFSVersion, this.Tracer, new GitHubUpgrader.GitHubUpgraderConfig(this.Tracer, this.LocalConfig)); this.PrerunChecker.Reset(); this.Upgrader.PretendNewReleaseAvailableAtRemote( upgradeVersion: NewerThanLocalVersion, remoteRing: GitHubUpgrader.GitHubUpgraderConfig.RingType.Slow); this.SetUpgradeRing("Slow"); }
public void CreatesGitHubUpgraderWhenConfigured() { MockLocalGVFSConfig gvfsConfig = this.ConstructDefaultGitHubConfigBuilder() .Build(); bool success = ProductUpgrader.TryCreateUpgrader( this.tracer, this.fileSystemMock.Object, gvfsConfig, this.credentialStoreMock.Object, false, false, out ProductUpgrader productUpgrader, out string error); success.ShouldBeTrue(); productUpgrader.ShouldNotBeNull(); productUpgrader.ShouldBeOfType <GitHubUpgrader>(); error.ShouldBeNull(); }
public void NoUpgraderWhenNuGetPackNameMissing() { MockLocalGVFSConfig gvfsConfig = this.ConstructDefaultMockNuGetConfigBuilder() .WithNoUpgradeFeedPackageName() .Build(); bool success = ProductUpgrader.TryCreateUpgrader( this.tracer, this.fileSystemMock.Object, gvfsConfig, this.credentialStoreMock.Object, false, false, out ProductUpgrader productUpgrader, out string error); success.ShouldBeFalse(); productUpgrader.ShouldBeNull(); error.ShouldNotBeNull(); }