CultPong/Assets/Scripts/Parsley/AssertionException.cs
2020-09-25 07:12:38 +01:00

20 lines
No EOL
619 B
C#

namespace Parsley
{
using System;
internal class AssertionException : Exception
{
public AssertionException(object expected, object actual)
: base(ExpectationDetails(expected, actual))
{
}
public AssertionException(string message, object expected, object actual)
: base(Environment.NewLine + message + ExpectationDetails(expected, actual))
{
}
private static string ExpectationDetails(object expected, object actual)
=> $"{Environment.NewLine}Expected: {expected}{Environment.NewLine}But was: {actual}";
}
}