classdef TestDrawContours
    %TestDrawContours
    properties (Constant)
        img = uint8([...
            0 0 0 0 0 0 0 0 0 0;...
            0 0 0 0 0 0 0 0 1 0;...
            0 0 0 0 0 0 0 0 0 0;...
            0 0 0 1 1 1 0 0 0 0;...
            0 0 0 1 1 1 0 0 0 0;...
            0 0 0 1 1 1 0 0 0 0;...
            0 0 0 0 0 0 0 0 0 0;...
            0 0 0 0 0 0 1 1 0 0;...
            0 0 0 0 0 1 1 1 0 0;...
            0 0 0 0 0 0 0 0 0 0;...
            ]);
    end
    
    methods (Static)
        function test_1
            [contours, hierarchy] = cv.findContours(TestDrawContours.img);
            im = cv.drawContours(TestDrawContours.img,contours,'Hierarchy',hierarchy);
        end
        
        function test_error_1
            try
                cv.drawContours();
                throw('UnitTest:Fail');
            catch e
                assert(strcmp(e.identifier,'mexopencv:error'));
            end
        end
    end
    
end

