public void OnFail(string message, AssertionHandlingMethod method) { switch (method) { case AssertionHandlingMethod.Console: { Console.WriteLine(message); return; } case AssertionHandlingMethod.Log: { XLog.LogError(new DebugLogMessage() { Message = new Message() { Value = message } }); return; } case AssertionHandlingMethod.Throw: { throw XExceptions.Exception(message); } default: { Console.WriteLine(method); return; } } }
public bool Assert(bool condition, AssertionHandlingMethod method, string message) { if (condition) { return(true); } OnFail(message, method); return(false); }
public static bool Assert(bool condition, AssertionHandlingMethod method, string message) { return(Api.Assert(condition, method, message)); }