mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-05 23:06:10 +00:00
31 lines
1.2 KiB
C#
31 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.Serialization;
|
|
|
|
namespace Octokit.Tests.Conventions
|
|
{
|
|
public class InterfaceHasAdditionalMethodsException : Exception
|
|
{
|
|
public InterfaceHasAdditionalMethodsException(Type type, IEnumerable<string> methodsMissingOnReactiveClient)
|
|
: base(CreateMessage(type, methodsMissingOnReactiveClient))
|
|
{ }
|
|
|
|
public InterfaceHasAdditionalMethodsException(Type type, IEnumerable<string> methodsMissingOnReactiveClient, Exception innerException)
|
|
: base(CreateMessage(type, methodsMissingOnReactiveClient), innerException)
|
|
{ }
|
|
|
|
protected InterfaceHasAdditionalMethodsException(SerializationInfo info, StreamingContext context)
|
|
: base(info, context)
|
|
{ }
|
|
|
|
static string CreateMessage(Type type, IEnumerable<string> methods)
|
|
{
|
|
var methodsFormatted = string.Join("\r\n", methods.Select(m => string.Format(" - {0}", m)));
|
|
return "Methods found on type {0} which should be removed:\r\n{1}"
|
|
.FormatWithNewLine(
|
|
type.Name,
|
|
methodsFormatted);
|
|
}
|
|
}
|
|
} |