示例#1
0
 public void ConstructorWithContentTypeShouldSetContentType()
 {
     MimeEntity e = new MimeEntity("Hello, world", "text/silly; charset=uk-monty");
     Assert.True(e.HasHeaders);
     Assert.True(e.HasHeader("content-type"));
     Assert.True(e.HasMediaType("text/silly"));
     Assert.Equal("text/silly; charset=uk-monty", e.ContentType);
 }
示例#2
0
 public void MimeEntityShouldHaveHeaders()
 {
     MimeEntity e = new MimeEntity("Hello, world", "text/silly");
     e.ContentDisposition = "inline";
     e.ContentTransferEncoding = "base64";
     e.Headers.Add(new Header("foo", "bar"));
     
     Assert.True(e.HasHeader("FOO"));
     Assert.Equal(4, e.Headers.Count);
 }
示例#3
0
 /// <summary>
 /// Tests the <paramref name="entity"/> to see if it contains an MDN request.
 /// </summary>
 /// <param name="entity">The entity to test</param>
 /// <returns><c>true</c> if the entity contains an MDN request, <c>false</c> otherwise</returns>
 public static bool HasMDNRequest(MimeEntity entity)
 {
     if (entity == null)
     {
         return false;
     }
     
     return entity.HasHeader(Headers.DispositionNotificationTo);
 }