public void NoTopLevelLineReturnsNoResults( string line1, string line2, ProcessNugetQueryResults sut) { sut.Process(new[] { line1, line2 }) .Should().BeEmpty(); }
public void LinesIncludedOnlyIfHavePrefix( string line1, string line2, ProcessNugetQueryResults sut) { line2 = $"{ProcessNugetQueryResults.Prefix}{line2}"; sut.Process(new[] { line1, line2 }); sut.LineParser.Received(1).TryParse(line2, out Arg.Any <string?>(), out Arg.Any <string?>(), out Arg.Any <string?>(), out Arg.Any <string?>()); }
public void LineParserSkipRespected( string line1, string line2, ProcessNugetQueryResults sut) { line2 = $"{ProcessNugetQueryResults.Prefix}{line2}"; sut.LineParser.TryParse(line2, out _, out _, out _, out _).Returns( _ => { return(false); }); sut.Process(new[] { line1, line2 }) .Should().BeEmpty(); }
public void ParserResultsGetReturned( string line1, string line2, string package, string requested, string resolved, string latest, ProcessNugetQueryResults sut) { line2 = $"{ProcessNugetQueryResults.Prefix}{line2}"; sut.LineParser.TryParse(line2, out _, out _, out _, out _).Returns(x => { x[1] = package; x[2] = requested; x[3] = resolved; x[4] = latest; return(true); }); sut.Process(new[] { line1, line2 }) .Should().Equal( new NugetListingQuery(package, requested, resolved, latest)); }
public void NoResultsReturnsNoResults( ProcessNugetQueryResults sut) { sut.Process(Array.Empty <string>()) .Should().BeEmpty(); }