コード例 #1
0
        public void With_StreamTo_EncryptorTestFile_Then_StreamPosition_IsNotAltered(
            Stream streamToTestFileStub,
            SutBitmapFileStructureProvider sut
            )
        {
            //Given
            var expectedOriginalStreamPosition = streamToTestFileStub.Position;

            //When
            var fileStructureInfoReturned = sut.GetStructureInfo(streamToTestFileStub);

            //Then
            streamToTestFileStub.Position.Should().Be(expectedOriginalStreamPosition);
        }
コード例 #2
0
        public void With_StreamTo_EncryptorTestFile_Then_CorrectFileStructure_IsReturned(
            Stream streamToTestFileStub,
            SutBitmapFileStructureProvider sut
            )
        {
            //Given
            var expectedBytesPerPixel   = 3;
            var expectedImageBytesCount = 5325600;

            //When
            var fileStructureInfoReturned = sut.GetStructureInfo(streamToTestFileStub);

            //Then
            fileStructureInfoReturned.ImageBytesCount.Should().Be(expectedImageBytesCount);
            fileStructureInfoReturned.BytesPerPixel.Should().Be(expectedBytesPerPixel);
        }