Ejemplo n.º 1
0
        public void RangeShouldHaveCorrectStringRepresentation()
        {
            const string expected = "8-88";
            string       actual   = NntpArticleRange.Range(8, 88).ToString();

            Assert.Equal(expected, actual);
        }
Ejemplo n.º 2
0
        public void AllFollowingShouldHaveCorrectStringRepresentation()
        {
            const string expected = "8-";
            string       actual   = NntpArticleRange.AllFollowing(8).ToString();

            Assert.Equal(expected, actual);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// The <a href="https://tools.ietf.org/html/rfc3977#section-6.1.2">LISTGROUP</a>
 /// command selects a newsgroup in the same manner as the
 /// GROUP command (see Section 6.1.1) but also provides a list of article
 /// numbers in the newsgroup. Only article numbers in the specified range are included in the list.
 /// </summary>
 /// <param name="group">The name of the group to select.</param>
 /// <param name="range">Only include article numbers within this range in the list.</param>
 /// <returns>A group response object.</returns>
 public NntpGroupResponse ListGroup(string group, NntpArticleRange range) =>
 connection.MultiLineCommand($"LISTGROUP {group.ThrowIfNullOrWhiteSpace(nameof(group))} {range}", new ListGroupResponseParser());
Ejemplo n.º 4
0
 /// <summary>
 /// The <a href="https://tools.ietf.org/html/rfc3977#section-8.5">HDR</a>
 /// command provides access to specific fields from an article
 /// specified by message-id, or from a specified article or range of
 /// articles in the currently selected newsgroup.
 /// </summary>
 /// <param name="field">The header field to retrieve.</param>
 /// <param name="range">Only include article numbers within this range in the list.</param>
 /// <returns>A multi-line response containing the specfied header fields.</returns>
 public NntpMultiLineResponse Hdr(string field, NntpArticleRange range) =>
 connection.MultiLineCommand($"HDR {field} {range}", new MultiLineResponseParser(225));
Ejemplo n.º 5
0
 /// <summary>
 /// The <a href="https://tools.ietf.org/html/rfc3977#section-8.6">LIST HEADERS</a>
 /// command returns a list of fields that may be
 /// retrieved using the HDR command.
 /// </summary>
 /// <param name="range">Only include article numbers within this range in the list.</param>
 /// <returns>A multi-line response containg a list of header
 /// fields that may be retrieved using the HDR command.</returns>
 public NntpMultiLineResponse ListHeaders(NntpArticleRange range) =>
 connection.MultiLineCommand($"LIST HEADERS {range}", new MultiLineResponseParser(215));
Ejemplo n.º 6
0
 /// <summary>
 /// The <a href="https://tools.ietf.org/html/rfc3977#section-8.3">OVER</a>
 /// command returns the contents of all the fields in the
 /// database for an article specified by message-id, or from a specified
 /// article or range of articles in the currently selected newsgroup.
 /// </summary>
 /// <param name="range">Only include article numbers within this range in the list.</param>
 /// <returns>A multi-line response containing header fields.</returns>
 public NntpMultiLineResponse Over(NntpArticleRange range) =>
 connection.MultiLineCommand($"OVER {range}", new MultiLineResponseParser(224));
Ejemplo n.º 7
0
        //connection.MultiLineCommand($"XZHDR {field}", new MultiLineResponseParser(221), true);

        /// <summary>
        /// Needs a <a href="https://gist.github.com/keimpema/ec962384d5fe3eb7a5f5030353ba9e2b">decompressing connection</a>.
        /// </summary>
        /// <param name="range"></param>
        /// <returns></returns>
        public NntpMultiLineResponse Xzver(NntpArticleRange range) => throw new NotImplementedException();
Ejemplo n.º 8
0
        //connection.MultiLineCommand($"XZHDR {field} {messageId}", new MultiLineResponseParser(221), true);

        /// <summary>
        /// Needs a <a href="https://gist.github.com/keimpema/ec962384d5fe3eb7a5f5030353ba9e2b">decompressing connection</a>.
        /// </summary>
        /// <param name="field"></param>
        /// <param name="range"></param>
        /// <returns></returns>
        public NntpMultiLineResponse Xzhdr(string field, NntpArticleRange range) => throw new NotImplementedException();
Ejemplo n.º 9
0
 private static void TestXover(NntpClient client, NntpGroup group)
 {
     // xover
     ShowLines(client.Xover(NntpArticleRange.Range(group.HighWaterMark, group.HighWaterMark)).Lines);
 }
Ejemplo n.º 10
0
 private static void TestXhdr(NntpClient client, NntpGroup group)
 {
     // xhdr
     ShowLines(client.Xhdr("Subject", NntpArticleRange.Range(group.HighWaterMark, group.HighWaterMark)).Lines);
 }