internal static void AssertAwesomelyWithCaseSensitivity <T>(
            this T actual, Func <T, bool> specifiedConstraint,
            object originalActual, object originalExpected,
            Case caseSensitivity, Func <string> customMessage = null)
        {
            try
            {
                if (specifiedConstraint(actual))
                {
                    return;
                }
            }
            catch (ArgumentException ex)
            {
                throw new ShouldAssertException(ex.Message, ex);
            }

            var message = new ExpectedActualWithCaseSensitivityShouldlyMessage(originalExpected, originalActual, caseSensitivity, customMessage);

            throw new ShouldAssertException(message.ToString());
        }
Example #2
0
        public static void AssertAwesomelyWithCaseSensitivity <T>(
            this T actual, Func <T, bool> specifiedConstraint,
            object?originalActual, object?originalExpected,
            Case caseSensitivity, string?customMessage = null,
            [CallerMemberName] string shouldlyMethod   = null !)
        {
            try
            {
                if (specifiedConstraint(actual))
                {
                    return;
                }
            }
            catch (ArgumentException ex)
            {
                throw new ShouldAssertException(ex.Message, ex);
            }

            var message = new ExpectedActualWithCaseSensitivityShouldlyMessage(originalExpected, originalActual, caseSensitivity, customMessage, shouldlyMethod);

            throw new ShouldAssertException(message.ToString());
        }