internal static bool Equal()

in src/PSDocs/Common/ExpressionHelpers.cs [40:57]


        internal static bool Equal(object expectedValue, object actualValue, bool caseSensitive, bool convertExpected = false, bool convertActual = false)
        {
            if (TryString(expectedValue, out string s1) && TryString(actualValue, out string s2))
                return StringEqual(s1, s2, caseSensitive);

            if (TryBool(expectedValue, convertExpected, out bool b1) && TryBool(actualValue, convertActual, out bool b2))
                return b1 == b2;

            if (TryLong(expectedValue, convertExpected, out long l1) && TryLong(actualValue, convertActual, out long l2))
                return l1 == l2;

            if (TryInt(expectedValue, convertExpected, out int i1) && TryInt(actualValue, convertActual, out int i2))
                return i1 == i2;

            var expectedBase = GetBaseObject(expectedValue);
            var actualBase = GetBaseObject(actualValue);
            return expectedBase.Equals(actualBase) || expectedValue.Equals(actualValue);
        }