public void GetAttachmentReturnsNamedAttachment() { var log = new StructuredDocument(); var data = new AttachmentData("foo", MimeTypes.Binary, AttachmentType.Binary, null, new byte[0]); log.Attachments.Add(data); log.Attachments.Add(new AttachmentData("bar", MimeTypes.Binary, AttachmentType.Binary, null, new byte[0])); Assert.AreSame(data, log.GetAttachment("foo")); }
public void GetStreamReturnsNullIfStreamNotFound() { var log = new StructuredDocument(); log.Streams.Add(new StructuredStream("bar")); Assert.IsNull(log.GetAttachment("foo")); }
public void GetAttachmentThrowsIfNameIsNull() { var log = new StructuredDocument(); Assert.Throws<ArgumentNullException>(() => log.GetAttachment(null)); }
public void GetAttachmentReturnsNullIfAttachmentNotFound() { var log = new StructuredDocument(); log.Attachments.Add(new AttachmentData("bar", MimeTypes.Binary, AttachmentType.Binary, null, new byte[0])); Assert.IsNull(log.GetAttachment("foo")); }