コード例 #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 == "*");
        }
コード例 #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 == "*");
        }
コード例 #3
0
ファイル: MatchingContext.cs プロジェクト: smstuebe/impact
        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
            });
        }