a bit of tidy up

This commit is contained in:
Brendan Forster
2020-02-28 17:19:41 -04:00
parent 0b7bfec94a
commit bf5b2f2d24
2 changed files with 29 additions and 27 deletions
+23 -23
View File
@@ -71,31 +71,31 @@ namespace Octokit.CodeGen
return data;
};
static readonly Func<VerbResult, string> convertVerbToMethodName = (verb) =>
{
if (verb.Method == HttpMethod.Get)
{
// what about Get with 200 response being a list?
// this should be GetAll instead to align with our conventions?
return "Get";
}
if (verb.Method == HttpMethod.Delete)
{
return "Delete";
}
if (verb.Method == HttpMethod.Put)
{
return "GetOrCreate";
}
return "???";
};
public static readonly TypeBuilderFunc AddMethodForEachVerb = (metadata, data) =>
{
Func<VerbResult, string> convertVerbToMethodName = (verb) =>
{
if (verb.Method == HttpMethod.Get)
{
// what about Get with 200 response being a list?
// this should be GetAll instead to align with our conventions?
return "Get";
}
if (verb.Method == HttpMethod.Delete)
{
return "Delete";
}
if (verb.Method == HttpMethod.Put)
{
return "GetOrCreate";
}
return "???";
};
Func<VerbResult, List<ApiParameterResult>> convertToParameters = (verb) =>
{
var list = new List<ApiParameterResult>();
@@ -5,12 +5,16 @@ namespace Octokit.CodeGen.Tests
{
public class PathFilterTests
{
readonly PathFilter pathFilter;
public PathFilterTests()
{
pathFilter = new PathFilter();
}
[Fact]
public void Allow_WhenUnset_BlocksEverything()
{
var pathFilter = new PathFilter();
var items = new List<PathMetadata> {{
new PathMetadata()
{
@@ -24,8 +28,6 @@ namespace Octokit.CodeGen.Tests
[Fact]
public void Allow_WithPrefixMatchingPath_PassesThrough()
{
var pathFilter = new PathFilter();
pathFilter.Allow("/foo");
var items = new List<PathMetadata> {{