Exemplo n.º 1
0
        public bool Equals(IPropertyPathPart other)
        {
            var otherProperty = other as PropertyPathPart;

            if (ReferenceEquals(otherProperty, null))
            {
                return(false);
            }

            return(string.Equals(Value, otherProperty.Value, StringComparison.InvariantCultureIgnoreCase) || Value == "*" || otherProperty?.Value == "*");
        }
Exemplo n.º 2
0
        public bool Equals(IPropertyPathPart other)
        {
            var otherArray = other as ArrayIndexPathPart;

            if (ReferenceEquals(otherArray, null))
            {
                return(false);
            }

            if (exact || otherArray.exact)
            {
                return(Value == otherArray.Value);
            }

            return(Value == otherArray.Value || Value == "*" || otherArray.Value == "*");
        }
Exemplo n.º 3
0
        public MatchingContext For(IPropertyPathPart property, bool?ignoreExpected = null, params IMatcher[] additionalMatchers)
        {
            var matchers = Matchers;

            if (additionalMatchers != null && additionalMatchers.Any())
            {
                matchers = Matchers.Concat(additionalMatchers).ToArray();
            }

            return(new MatchingContext(matchers, IsRequest, new List <IPropertyPathPart>(PropertyPath)
            {
                property
            }, Result)
            {
                IgnoreExpected = ignoreExpected.GetValueOrDefault(IgnoreExpected),
                TerminationRequested = TerminationRequested
            });
        }