mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 04:16:51 +00:00
a bit of tidy up
This commit is contained in:
@@ -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> {{
|
||||
|
||||
Reference in New Issue
Block a user