Exemplo n.º 1
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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 4
0
        public void RemoveElement()
        {
            var underTest = new IgnoredEntitiesCollection();

            Assert.That(underTest.IsIgnoredId(this.objectId), Is.EqualTo(IgnoredState.NOT_IGNORED));

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

            Assert.That(underTest.IsIgnoredId(this.objectId), Is.EqualTo(IgnoredState.NOT_IGNORED));
        }
Exemplo n.º 5
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));
        }
Exemplo n.º 6
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));
        }