public IsIgnored ( IDocument doc ) : IgnoredState | ||
doc | IDocument | |
return | IgnoredState |
public IgnoredState IsIgnored(IDocument doc) {
if (doc == null) {
throw new ArgumentNullException("doc");
}
if (this.IsIgnoredId(doc.Id) == IgnoredState.IGNORED) {
return IgnoredState.IGNORED;
} else {
if (doc.Parents != null && doc.Parents.Count > 0) {
if (this.IsIgnored(doc.Parents[0]) != IgnoredState.NOT_IGNORED) {
return IgnoredState.INHERITED;
}
}
}
return IgnoredState.NOT_IGNORED;
}
IgnoredEntitiesCollection::IsIgnored ( IFolder folder ) : IgnoredState |
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)); }