Esempio n. 1
0
        /// <summary>
        /// Gets a value that indicates whether the current instance matches the specified manifest item and value response.
        /// </summary>
        /// <remarks>
        /// <para>
        /// This method is used only to detect circular references in the validated object model.
        /// Circular references are not validated, because they would lead to an endless loop.
        /// </para>
        /// </remarks>
        /// <param name="item">A manifest item</param>
        /// <param name="valueResponse">A value response</param>
        /// <returns><see langword="true" /> if the current instance matches the item and value response; <see langword="false" /> otherwise.</returns>
        public bool IsMatch(IManifestItem item, GetValueToBeValidatedResponse valueResponse)
        {
            if (item is null)
            {
                throw new ArgumentNullException(nameof(item));
            }
            if (valueResponse is null)
            {
                throw new ArgumentNullException(nameof(valueResponse));
            }

            IManifestItem
                thisItem = GetManifestItemForMatching(ManifestValue),
                thatItem = GetManifestItemForMatching(item);

            return(ReferenceEquals(thisItem, thatItem) && Equals(ValueResponse, valueResponse));
        }
 /// <inheritdoc/>
 public override bool Equals(GetValueToBeValidatedResponse other) => ReferenceEquals(this, other);