Bickle.SpecDescriber.ExtractOperator C# (CSharp) Method

ExtractOperator() private static method

private static ExtractOperator ( BinaryExpression binary ) : string
binary System.Linq.Expressions.BinaryExpression
return string
        private static string ExtractOperator(BinaryExpression binary)
        {
            string op = Regex.Match(binary.ToString(), " (==|=|!=|<=|>=|<|>) ").Groups[1].Value;

            if (op == "==" ||op =="=")
                return "should equal";
            if (op == "!=")
                return "should not equal";
            if (op == "<=")
                return "should be less than or equal to";
            if (op == "<")
                return "should be less than";
            if (op == ">=")
                return "should be greater than or equal to";
            if (op == ">")
                return "should be greater than";

            return "should " + op;
        }