Beispiel #1
0
 /// <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)]);
 }
Beispiel #2
0
            public void ExceptionOnExternalReference()
            {
                var container = new BCFv21Container();
                var docRef    = new TopicDocumentReference();

                docRef.isExternal = true;
                Assert.Throws <ArgumentException>(() =>
                {
                    var data = container.GetAttachmentForDocumentReference(docRef);
                });
            }