Example #1
0
        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;
            }
            }
        }
Example #2
0
        public bool Assert(bool condition, AssertionHandlingMethod method, string message)
        {
            if (condition)
            {
                return(true);
            }

            OnFail(message, method);

            return(false);
        }
Example #3
0
File: XDebug.cs Project: E01D/Base
 public static bool Assert(bool condition, AssertionHandlingMethod method, string message)
 {
     return(Api.Assert(condition, method, message));
 }