/// <summary> /// Returns the raw byte array of the attachment /// </summary> /// <param name="topicDocumentReference"></param> /// <returns></returns> public byte[] GetAttachmentForDocumentReference(TopicDocumentReference topicDocumentReference) { if (topicDocumentReference.isExternal) { throw new ArgumentException("Reference is external"); } return(FileAttachments[GetFilenameFromReference(topicDocumentReference.ReferencedDocument)]); }
public void ExceptionOnExternalReference() { var container = new BCFv21Container(); var docRef = new TopicDocumentReference(); docRef.isExternal = true; Assert.Throws <ArgumentException>(() => { var data = container.GetAttachmentForDocumentReference(docRef); }); }