Files
octokit.net/Octokit.Tests.Conventions/Exception/PaginationGetAllMethodNameMismatchException.cs
2015-12-16 21:23:36 +02:00

26 lines
865 B
C#

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);
}
}
}