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)); }
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)); }
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)); }
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)); }
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)); }