/// <summary>
        /// Checks that the actual value is not equal to another expected value.
        /// </summary>
        /// <typeparam name="T">
        /// Type of the checked value.
        /// </typeparam>
        /// <param name="check">The fluent check to be extended.</param>
        /// <param name="expected">The expected value.</param>
        /// <returns>
        /// A check link.
        /// </returns>
        /// <exception cref="FluentCheckException">The actual value is equal to the expected value.</exception>
        public static ICheckLink <ICheck <T> > IsNotEqualTo <T>(this ICheck <T> check, object expected)
        {
            var checker = ExtensibilityHelper.ExtractChecker(check);

            return(checker.ExecuteCheck(
                       () => EqualityHelper.IsNotEqualTo(checker, expected),
                       EqualityHelper.BuildErrorMessage(checker, expected, false)));
        }
Example #2
0
        /// <summary>
        /// Checks that the actual value is not equal to another expected value.
        /// </summary>
        /// <typeparam name="T">Type of the struct or the enum to assert on.</typeparam>
        /// <param name="check">The fluent check to be extended.</param>
        /// <param name="expected">The expected value.</param>
        /// <returns>
        /// A check link.
        /// </returns>
        /// <exception cref="FluentCheckException">The actual value is equal to the expected value.</exception>
        public static ICheckLink <IStructCheck <T> > IsNotEqualTo <T>(this IStructCheck <T> check, object expected) where T : struct
        {
            var runnableStructCheck = ExtensibilityHelper.ExtractStructChecker(check);

            return(runnableStructCheck.ExecuteCheck(
                       () => EqualityHelper.IsNotEqualTo(runnableStructCheck, expected),
                       EqualityHelper.BuildErrorMessage(runnableStructCheck, expected, false)));
        }
Example #3
0
        /// <summary>
        /// Checks that the actual value is not equal to another expected value.
        /// </summary>
        /// <typeparam name="T">Type of the struct or the enum to assert on.</typeparam>
        /// <param name="fluentAssertion">The fluent assertion to be extended.</param>
        /// <param name="expected">The expected value.</param>
        /// <returns>
        /// A chainable assertion.
        /// </returns>
        /// <exception cref="FluentAssertionException">The actual value is equal to the expected value.</exception>
        public static IChainableFluentAssertion <IStructFluentAssertion <T> > IsNotEqualTo <T>(this IStructFluentAssertion <T> fluentAssertion, object expected) where T : struct
        {
            var assertionRunner   = fluentAssertion as IStructFluentAssertionRunner <T>;
            var runnableAssertion = fluentAssertion as IRunnableAssertion <T>;

            return(assertionRunner.ExecuteAssertion(
                       () =>
            {
                EqualityHelper.IsNotEqualTo(runnableAssertion.Value, expected);
            },
                       EqualityHelper.BuildErrorMessage(runnableAssertion.Value, expected, false)));
        }
Example #4
0
        /// <summary>
        /// Checks that the actual value is not equal to another expected value.
        /// </summary>
        /// <returns>A chainable assertion.</returns>
        /// <param name="expected">The expected value.</param>
        /// <exception cref="FluentAssertionException">The actual value is equal to the expected value.</exception>
        public IChainableFluentAssertion <IFluentAssertion <N> > IsNotEqualTo(object expected)
        {
            var assertionRunner = this.fluentAssertion as IFluentAssertionRunner <N>;
            IRunnableAssertion <N> runnableAssertion = this;

            return(assertionRunner.ExecuteAssertion(
                       () =>
            {
                EqualityHelper.IsNotEqualTo(runnableAssertion.Value, expected);
            },
                       EqualityHelper.BuildErrorMessage(runnableAssertion.Value, expected, false)));
        }
Example #5
0
        /// <summary>
        /// Checks that the actual value is not equal to another expected value.
        /// </summary>
        /// <param name="fluentAssertion">The fluent assertion to be extended.</param>
        /// <param name="expected">The expected.</param>
        /// <returns>
        /// A chainable assertion.
        /// </returns>
        /// <exception cref="FluentAssertionException">The actual value is equal to the expected value.</exception>
        public static IChainableFluentAssertion <IFluentAssertion <bool> > IsNotEqualTo(this IFluentAssertion <bool> fluentAssertion, object expected)
        {
            var assertionRunner   = fluentAssertion as IFluentAssertionRunner <bool>;
            var runnableAssertion = fluentAssertion as IRunnableAssertion <bool>;

            return(assertionRunner.ExecuteAssertion(
                       () =>
            {
                EqualityHelper.IsNotEqualTo(runnableAssertion.Value, expected);
            },
                       EqualityHelper.BuildErrorMessage(runnableAssertion.Value, expected, false)));
        }