CmisCmdlets.Tests.Constraints.CmisObjectHasPropertyConstraint.Matches C# (CSharp) Méthode

Matches() public méthode

public Matches ( object obj ) : bool
obj object
Résultat bool
        public override bool Matches(object obj)
        {
            var cmisObj = obj as ICmisObject;
            if (cmisObj == null)
            {
                return Problem("A cmis object", "Something else");
            }
            foreach (var prop in cmisObj.Properties)
            {
                if (!prop.LocalName.Equals(_propertyName))
                {
                    continue;
                }
                if (!prop.Value.Equals(_propertyValue))
                {
                    return Problem("Object with property value {0}", _propertyValue, prop.Value);
                }
                return true;
            }
            return Problem("Object with the specified property", "Object without that property");
        }
    }
CmisObjectHasPropertyConstraint