mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 12:26:18 +00:00
Add a convention test
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit.Tests.Conventions
|
||||
{
|
||||
public class PaginationGetAllMethodNameMismatchException : Exception
|
||||
{
|
||||
public PaginationGetAllMethodNameMismatchException(Type type, IEnumerable<MethodInfo> methods)
|
||||
: base(CreateMessage(type, methods)) { }
|
||||
|
||||
static string CreateMessage(Type type, IEnumerable<MethodInfo> methods)
|
||||
{
|
||||
var methodsFormatted = String.Join("\r\n", methods.Select(m => String.Format(" - {0}", m)));
|
||||
return "Methods found on type {0} should follow the 'GetAll*' naming convention:\r\n{1}"
|
||||
.FormatWithNewLine(
|
||||
type.Name,
|
||||
methodsFormatted);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user