IsIgnored() public method

public IsIgnored ( IDocument doc ) : IgnoredState
doc IDocument
return IgnoredState
コード例 #1
0
        public void IgnoreCheckOfSubDocumentWithoutParent() {
            var underTest = new IgnoredEntitiesCollection();
            var doc = new Mock<IDocument>();
            doc.Setup(f => f.Id).Returns(Guid.NewGuid().ToString());
            var parents = new List<IFolder>();
            doc.Setup(f => f.Parents).Returns(parents);
            underTest.Add(Mock.Of<IIgnoredEntity>(o => o.ObjectId == this.objectId && o.LocalPath == this.localPath));

            Assert.That(underTest.IsIgnored(doc.Object), Is.EqualTo(IgnoredState.NOT_IGNORED));
        }
コード例 #2
0
 public void UpdateOfIgnoredDocument() {
     var underTest = new IgnoredEntitiesCollection();
     var oldEntry = Mock.Of<IIgnoredEntity>(o => o.ObjectId == this.objectId && o.LocalPath == "old path");
     var newEntry = Mock.Of<IIgnoredEntity>(o => o.ObjectId == this.objectId && o.LocalPath == this.localPath);
     underTest.Add(oldEntry);
     underTest.Add(newEntry);
     Assert.That(underTest.IsIgnored(Mock.Of<IDocument>(f => f.Id == this.objectId)), Is.EqualTo(IgnoredState.IGNORED));
 }
コード例 #3
0
        public void IgnoreCheckOfFolderIfParentIsNullAndRequestThrowsOjectNotFoundException() {
            var underTest = new IgnoredEntitiesCollection();
            var folder = new Mock<IFolder>();
            folder.Setup(f => f.Id).Returns(Guid.NewGuid().ToString());
            folder.Setup(f => f.FolderParent).Throws(new CmisObjectNotFoundException());

            Assert.That(underTest.IsIgnored(folder.Object), Is.EqualTo(IgnoredState.NOT_IGNORED));
        }
コード例 #4
0
        public void IgnoreCheckOfDocument() {
            var underTest = new IgnoredEntitiesCollection();

            underTest.Add(Mock.Of<IIgnoredEntity>(o => o.ObjectId == this.objectId && o.LocalPath == this.localPath));

            Assert.That(underTest.IsIgnored(Mock.Of<IDocument>(f => f.Id == this.objectId)), Is.EqualTo(IgnoredState.IGNORED));
        }
コード例 #5
0
        public void IgnoreCheckOfSubFolder() {
            var underTest = new IgnoredEntitiesCollection();
            var folder = new Mock<IFolder>();
            folder.Setup(f => f.Id).Returns(Guid.NewGuid().ToString());
            var parent = Mock.Of<IFolder>(f => f.Id == this.objectId);
            folder.Setup(f => f.FolderParent).Returns(parent);
            underTest.Add(Mock.Of<IIgnoredEntity>(o => o.ObjectId == this.objectId && o.LocalPath == this.localPath));

            Assert.That(underTest.IsIgnored(folder.Object), Is.EqualTo(IgnoredState.INHERITED));
        }