Esempio n. 1
0
        public void ConvolutionFilterTestOfExceptionWithMatrix()
        {
            //Substitute for ManagerEdge
            InterfaceEdge edgeInterface = Substitute.For <ManagerEdge>();
            //Getting the original image to be sent
            Bitmap originalBitmap = RetrieveImage.RetrieveOriginalPicture();
            //Bitmap bitmapForVerification retrieved using the ConvolutionFilter method with a matrix null
            Bitmap filteredBitmap = edgeInterface.ConvolutionFilter(originalBitmap, null, 1.0, 0);

            Assert.AreEqual(null, filteredBitmap);
        }
Esempio n. 2
0
        public void Laplacian5x5FilterTestOutputPicture()
        {
            //Substitute for ManagerEdge
            InterfaceEdge edgeInterface = Substitute.For <ManagerEdge>();

            Bitmap originalBitmap        = RetrieveImage.RetrieveOriginalPicture();
            Bitmap bitmapForVerification = RetrieveImage.RetrieveImageFromPath("Laplacian5x5.jpg");
            Bitmap filteredBitmap        = edgeInterface.Lalpacian5x5(new Bitmap(originalBitmap));

            Assert.IsTrue(RetrieveImage.Equals(bitmapForVerification, filteredBitmap));
        }
Esempio n. 3
0
        public void ConvolutionFilterTestOfExceptionWithBitmap()
        {
            //Substitute for ManagerEdge
            InterfaceEdge edgeInterface = Substitute.For <ManagerEdge>();
            //Getting the original image to be sent
            Bitmap originalBitmap = null;
            //Bitmap bitmapForVerification retrieved using the ConvolutionFilter method with a originalBitmap null
            Bitmap filteredBitmap = edgeInterface.ConvolutionFilter(originalBitmap, new double[, ]
            {
                { -1, -1, -1, },
                { -1, 8, -1, },
                { -1, -1, -1, },
            }, 1.0, 0);

            Assert.AreEqual(null, filteredBitmap);
        }