コード例 #1
0
        public void FilePartShouldBeDecoded()
        {
            const int  expectedDataLength = 11250;
            YencStream actualStream       = YencStreamDecoder.Decode(
                testData.GetEmbeddedFile(@"yenc.multipart.00000020.ntx").ReadAllLines(UsenetEncoding.Default));

            byte[] actualData = actualStream.ReadAllBytes();

            Assert.True(actualStream.Header.IsFilePart);
            Assert.Equal(expectedDataLength, actualData.Length);
        }
コード例 #2
0
        public void SinglePartFileShouldBeDecoded()
        {
            byte[] expectedData = testData.GetEmbeddedFile(@"yenc.singlepart.testfile.txt").ReadAllBytes();

            YencStream actualStream = YencStreamDecoder.Decode(
                testData.GetEmbeddedFile(@"yenc.singlepart.00000005.ntx").ReadAllLines(UsenetEncoding.Default));

            byte[] actualData = actualStream.ReadAllBytes();

            Assert.False(actualStream.Header.IsFilePart);
            Assert.Equal(128, actualStream.Header.LineLength);
            Assert.Equal(584, actualStream.Header.FileSize);
            Assert.Equal("testfile.txt", actualStream.Header.FileName);
            Assert.Equal(584, actualData.Length);
            Assert.Equal(expectedData, actualData);
        }