private static Rescan CreateRescan(string packageId, string packageVersion) { var loggerMock = new Mock <ILogger <Rescan> >(); var args = new Dictionary <string, string> { { CommandLineArguments.PackageId, packageId }, { CommandLineArguments.PackageVersion, packageVersion }, { CommandLineArguments.ValidationId, Guid.NewGuid().ToString() }, { CommandLineArguments.Comment, "comment" }, { CommandLineArguments.Alias, "angrigor" }, }; var mc = new Rescan(args, loggerMock.Object, null, "container", null, null, "https://www.nuget.org/"); return(mc); }
public void Save() { if (Configuration is null) { return; } // Only need serialize settings that can be changed on UI: IConfigurationSection mainSettings = Configuration.GetSection(MainSection); mainSettings[nameof(StartComPort)] = StartComPort.ToString(); mainSettings[nameof(EndComPort)] = EndComPort.ToString(); mainSettings[nameof(ComPorts)] = string.Join(",", ComPorts); mainSettings[nameof(StartIDCode)] = StartIDCode.ToString(); mainSettings[nameof(EndIDCode)] = EndIDCode.ToString(); mainSettings[nameof(IDCodes)] = string.Join(",", IDCodes); mainSettings[nameof(Rescan)] = Rescan.ToString(); mainSettings[nameof(AutoStartParsingSequenceForScan)] = AutoStartParsingSequenceForScan.ToString(); mainSettings[nameof(ControllingConnection)] = ControllingConnection.ToString(); mainSettings[nameof(SourceConfig)] = SourceConfig; }
public bool Process() { bool returnValue; switch (target) { case Target.Delete: { Race race = new Race(args); race.ParseDelete(); race.ProcessDelete(); returnValue = race.IsValid; break; } case Target.Rescan: { Rescan rescan = new Rescan(args); rescan.Parse(); rescan.Process(); returnValue = true; break; } case Target.Upload: { Race race = new Race(args); race.ParseUpload(); race.Process(); returnValue = race.IsValid; break; } default: { return false; } } Log.Debug("Script returned code {0}", returnValue); return returnValue; }
public void PackageVersionUrlDecoded(string argument, string expectedPackageVersion) { Rescan mc = CreateRescan("Newtonsoft.Json", argument); Assert.Equal(expectedPackageVersion, mc.PackageVersion); }
public void PackageIdUrlDecoded(string argument, string expectedPackageid) { Rescan mc = CreateRescan(argument, "1.0.0"); Assert.Equal(expectedPackageid, mc.PackageId); }