CmisCmdlets.Tests.Constraints.CmisBaseConstraint.MatchObject C# (CSharp) Метод

MatchObject() защищенный Метод

protected MatchObject ( ICmisObject expected, ICmisObject actual ) : bool
expected ICmisObject
actual ICmisObject
Результат bool
        protected bool MatchObject(ICmisObject expected, ICmisObject actual)
        {
            if (actual == null)
            {
                return Problem("An ICmisObject", "Something else");
            }
            if (expected.BaseTypeId != actual.BaseTypeId)
            {
                return Problem("Object with BaseTypeId {0}", expected.BaseTypeId,
                    actual.BaseTypeId);
            }
            if (expected.Id != actual.Id)
            {
                return Problem("Object with Id \"{0}\"", expected.BaseTypeId,
                    actual.BaseTypeId);
            }
            /*
             * This would have to be done by hand. Skipping for now
            if (!expected.Properties.SequenceEqual(actual.Properties))
            {
                return Problem("Object with Properties \"{0}\"", expected.Properties,
                               actual.Properties);
            }
            */
            if (expected is IFolder)
            {
                return MatchFolder(expected as IFolder, actual as IFolder);
            }
            else if (expected is IDocument)
            {
                return MatchDocument(expected as IDocument, actual as IDocument);
            }
            return true;
        }