Files
octokit.net/Octokit.Tests.Conventions/Exception/ReturnValueMismatchException.cs
Mickaël Derriey 13d5dab516 Port to .NET Core (#1503)
Port to .NET Core
2017-01-21 14:42:02 +10:00

21 lines
776 B
C#

using System;
using System.Reflection;
namespace Octokit.Tests.Conventions
{
public class ReturnValueMismatchException : Exception
{
public ReturnValueMismatchException(MethodInfo method, Type expected, Type actual)
: base(CreateMessage(method, expected, actual))
{ }
public ReturnValueMismatchException(MethodInfo method, Type expected, Type actual, Exception innerException)
: base(CreateMessage(method, expected, actual), innerException)
{ }
static string CreateMessage(MethodInfo method, Type expected, Type actual)
{
return string.Format("Return value for {0}.{1} must be \"{2}\" but is \"{3}\"", method.DeclaringType.Name, method.Name, expected, actual);
}
}
}