CmisCmdlets.Tests.Constraints.CmisObjectExistsConstraint.Matches C# (CSharp) Метод

Matches() публичный Метод

public Matches ( object actual ) : bool
actual object
Результат bool
        public override bool Matches(object actual)
        {
            ExpectedValue = "Object should" + (_shouldExist ? "" : " not") + " exist.";
            ActualValue = "Object does" + (_shouldExist ? " not" : "") + " exist.";

            _session.Clear();
            try
            {
                var path = (string)actual;
                path = path.StartsWith("/") ? path : "/" + path;
                return _session.GetObjectByPath(path) != null ? _shouldExist : !_shouldExist;
            }
            catch(CmisBaseException)
            {
                return !_shouldExist;
            }
        }
    }
CmisObjectExistsConstraint