Esempio n. 1
0
        public void ArticleShouldBeWrittenCorrectly(XSerializable <NntpArticle> article, string[] expectedLines)
        {
            var connection = new MockConnection();

            ArticleWriter.Write(connection, article.Object);
            Assert.Equal(expectedLines, connection.GetLines());
        }
        public void ResponseShouldBeParsedCorrectly(
            int responseCode,
            string responseMessage,
            XSerializable <NntpGroup> expectedGroup)
        {
            NntpGroupResponse groupResponse = new GroupResponseParser().Parse(responseCode, responseMessage);

            Assert.Equal(expectedGroup.Object, groupResponse.Group);
        }
        public void MultiLineResponseShouldBeParsedCorrectly(
            int responseCode,
            string responseMessage,
            string[] lines,
            XSerializable <NntpGroup> expectedGroup)
        {
            NntpGroupResponse groupResponse = new ListGroupResponseParser().Parse(responseCode, responseMessage, lines.ToList());

            Assert.Equal(expectedGroup.Object, groupResponse.Group);
        }
Esempio n. 4
0
        public void ResponseShouldBeParsedCorrectly(
            int responseCode,
            string responseMessage,
            string[] lines,
            XSerializable <NntpGroupOrigin[]> expectedGroupOrigins)
        {
            NntpGroupOriginsResponse response = new GroupOriginsResponseParser().Parse(
                responseCode, responseMessage, lines.ToList());

            Assert.Equal(expectedGroupOrigins.Object, response.GroupOrigins);
        }
        public void MultiLineResponseShouldBeParsedCorrectly(
            int responseCode,
            string responseMessage,
            int validCode,
            int requestType,
            string[] lines,
            XSerializable <NntpGroup[]> expectedGroups)
        {
            NntpGroupsResponse response = new GroupsResponseParser(validCode, (GroupStatusRequestType)requestType)
                                          .Parse(responseCode, responseMessage, lines.ToList());

            Assert.Equal(expectedGroups.Object, response.Groups);
        }
        public void MultiLineResponseShouldBeParsedCorrectly(
            int responseCode,
            string responseMessage,
            int requestType,
            string[] lines,
            XSerializable <NntpArticle> expected)
        {
            NntpArticle         expectedArticle = expected.Object;
            NntpArticleResponse articleResponse = new ArticleResponseParser((ArticleRequestType)requestType)
                                                  .Parse(responseCode, responseMessage, lines.ToList());
            NntpArticle actualArticle = articleResponse.Article;

            Assert.Equal(expectedArticle, actualArticle);
        }
Esempio n. 7
0
 public void EqualsWithSameValuesShouldReturnTrue(XSerializable <NntpGroups> groups1, XSerializable <NntpGroups> groups2)
 {
     Assert.Equal(groups1.Object, groups2.Object);
 }
Esempio n. 8
0
 public void EqualsWithDifferentValuesShouldReturnFalse(XSerializable <NntpArticleRange> range1, XSerializable <NntpArticleRange> range2)
 {
     Assert.NotEqual(range1.Object, range2.Object);
 }
Esempio n. 9
0
 public void EqualsWithSameValuesShouldReturnTrue(XSerializable <NntpArticleRange> range1, XSerializable <NntpArticleRange> range2)
 {
     Assert.Equal(range1.Object, range2.Object);
 }
Esempio n. 10
0
 public void EqualsWithSameValuesShouldReturnTrue(XSerializable <NzbFile> expected, XSerializable <NzbFile> actual)
 {
     Assert.Equal(expected.Object, actual.Object);
 }
Esempio n. 11
0
 public void EqualsWithDifferentValuesShouldReturnFalse(XSerializable <NzbFile> expected, XSerializable <NzbFile> actual)
 {
     Assert.NotEqual(expected.Object, actual.Object);
 }
Esempio n. 12
0
 public void EqualsWithDifferentValuesShouldReturnFalse(XSerializable <NntpGroup> group1, XSerializable <NntpGroup> group2)
 {
     Assert.NotEqual(group1.Object, group2.Object);
 }