示例#1
0
        public void Should_Increase_Stride(double[] pixels, int width, int height, byte componentsAmount,
                                           double[] components, byte position, int result)
        {
            var image = new ZsImage(pixels, width, height, componentsAmount);

            image.InsertComponents(components, position);
            image.Stride.ShouldBe(result);
        }
示例#2
0
        public void Should_Throw_ArgumentOutOfRangeException_Index_Greater_Than_Components_Amount(double[] pixels, int width, int height, byte componentsAmount, double[] components, byte index, Type expectedType)
        {
            var image = new ZsImage(pixels, width, height, componentsAmount);

            var result = typeof(object);

            try
            {
                image.InsertComponents(components, index);
            }
            catch (Exception ex)
            {
                result = ex.GetType();
            }
            result.ShouldBe(expectedType);
        }
示例#3
0
        public void Should_Insert_Provided_Values(double[] pixels, int width, int height, byte componentsAmount, double[] components, byte index, double[] result, bool expected)
        {
            var image = new ZsImage(pixels, width, height, componentsAmount);

            image.InsertComponents(components, index);
            var pixels2 = image.PixelsData;

            var equal = result.Length == pixels2.Length;

            for (int i = 0; i < result.Length && equal; i++)
            {
                if (result[i] != pixels2[i])
                {
                    equal = false;
                }
            }

            equal.ShouldBe(expected);
        }