Example #1
0
        public void GetChunkSizesForItem_ItemIsNotCompressed_EmptyList()
        {
            var p4    = new NefsHeaderPart4(this.testItems);
            var sizes = p4.GetChunkSizesForItem(this.file4NotCompressed);

            Assert.Empty(sizes);
        }
Example #2
0
        public void GetChunkSizesForItem_ItemIsDirectory_EmptyList()
        {
            var p4    = new NefsHeaderPart4(this.testItems);
            var sizes = p4.GetChunkSizesForItem(this.dir1);

            Assert.Empty(sizes);
        }
Example #3
0
        public void GetChunkSizesForItem_ItemValid_ChunkSizesReturned()
        {
            var p4 = new NefsHeaderPart4(this.testItems);

            var file1Sizes = p4.GetChunkSizesForItem(this.file1);

            Assert.Equal(3, file1Sizes.Count);
            Assert.NotSame(this.file1.DataSource.Size.ChunkSizes, file1Sizes);
            Assert.True(file1Sizes.SequenceEqual(this.file1.DataSource.Size.ChunkSizes));

            var file2Sizes = p4.GetChunkSizesForItem(this.file2);

            Assert.Equal(3, file2Sizes.Count);
            Assert.NotSame(this.file2.DataSource.Size.ChunkSizes, file2Sizes);
            Assert.True(file2Sizes.SequenceEqual(this.file2.DataSource.Size.ChunkSizes));

            var file3Sizes = p4.GetChunkSizesForItem(this.file3);

            Assert.Equal(3, file3Sizes.Count);
            Assert.NotSame(this.file3.DataSource.Size.ChunkSizes, file3Sizes);
            Assert.True(file3Sizes.SequenceEqual(this.file3.DataSource.Size.ChunkSizes));
        }