Exemple #1
0
        public void CalculateImageHistogram_WhenCalledWithBytesPerPixelValueAsLessThanThree_ThrowsException()
        {
            // Arrange
            var colorBarChartCreator = new ColorBarChartCreator();
            var bytesPerPixel        = 0;
            var random             = new Random();
            var incorrectImageData = new byte[random.Next(100000, 200000)];

            //Act
            colorBarChartCreator.CalculateImageHistogram(incorrectImageData, bytesPerPixel);

            //Assert - Expects exception
        }
Exemple #2
0
        public void CalculateImageHistogram_WhenCalledWithImageDataOfIncorrectLength_ThrowsException()
        {
            // Arrange
            var colorBarChartCreator = new ColorBarChartCreator();
            var bytesPerPixel        = 3;
            var random             = new Random();
            var incorrectImageData = new byte[random.Next(100000, 200000) * bytesPerPixel - 1];

            //Act
            colorBarChartCreator.CalculateImageHistogram(incorrectImageData, bytesPerPixel);

            //Assert - Expects exception
        }