Specification.

NotEqual<T, TProperty>(Expression<Func<T, TProperty>>, TProperty, IEqualityComparer<TProperty>) Method

Summary

Creates EqualSpecification<T> negation for candidate property:

Checks if candidate object is not equal to expected object.

Namespace
FluentSpecification
Containing Type
Specification

Syntax

[PublicAPI]
[NotNull]
public static IComplexSpecification<T> NotEqual<T, TProperty>(Expression<Func<T, TProperty>> selector, TProperty notExpected, IEqualityComparer<TProperty> comparer = null)

Attributes

Type Description
PublicAPI
NotNull

Type Parameters

Name Description
T Type of candidate.
TProperty Type of candidate property to verify.

Parameters

Name Type Description
selector Expression<Func<T, TProperty>> Candidate property selector.
notExpected TProperty Not expected object.
comparer IEqualityComparer<TProperty> Equality comparer.

Return Value

Type Description
IComplexSpecification<T> New complex Specification for candidate property.

Exceptions

Type Description
System.ArgumentNullException Thrown when selector is null.
System.ArgumentException Thrown when selector is not valid.
GitHub