コード例 #1
0
        public void GetStreamReturnsNullIfStreamNotFound()
        {
            var log = new StructuredDocument();

            log.Streams.Add(new StructuredStream("bar"));
            Assert.IsNull(log.GetAttachment("foo"));
        }
コード例 #2
0
        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"));
        }
コード例 #3
0
        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"));
        }
コード例 #4
0
        public void GetAttachmentThrowsIfNameIsNull()
        {
            var log = new StructuredDocument();

            Assert.Throws <ArgumentNullException>(() => log.GetAttachment(null));
        }