Пример #1
0
        public virtual void testGetContentID()
        {
            testBuildMimePackageDocJMF();
            AttachmentCollection mp = MimeUtil.GetMultiPart(sm_dirTestDataTemp + "testMimePackageDoc.mjm");
            Attachment           bp = MimeUtil.GetPartByCID(mp, "JDF.jdf");

            Assert.IsNotNull(bp);
            Assert.AreEqual("JDF.jdf", bp.Name);
            Assert.AreEqual("JDF.jdf", MimeUtil.getContentID(bp));
            MimeUtil.setContentID(bp, "TheJDF");
            Assert.AreEqual("TheJDF", MimeUtil.getContentID(bp));
            MimeUtil.setContentID(bp, "<TheJDF>");
            Assert.AreEqual("TheJDF", MimeUtil.getContentID(bp));
            MimeUtil.setContentID(bp, "<cid:TheJDF>");
            Assert.AreEqual("TheJDF", MimeUtil.getContentID(bp));
        }