function res = test_ellipsoid_plotRandPoint
% test_ellipsoid_plotRandPoint - unit test function of plotRandPoint
%
% Syntax:
%    res = test_ellipsoid_plotRandPoint
%
% Inputs:
%    -
%
% Outputs:
%    res - true/false 
%
% Other m-files required: none
% Subfunctions: none
% MAT-files required: none
%
% See also: none

% Authors:       Mark Wetzlinger
% Written:       11-December-2022
% Last update:   ---
% Last revision: ---

% ------------------------------ BEGIN CODE -------------------------------

% init cases
E1 = ellipsoid([ 5.4387811500952807 12.4977183618314545 ; 12.4977183618314545 29.6662117284481646 ], [ -0.7445068341257537 ; 3.5800647524843665 ], 0.000001);
Ed1 = ellipsoid([ 4.2533342807136076 0.6346400221575308 ; 0.6346400221575309 0.0946946398147988 ], [ -2.4653656883489115 ; 0.2717868749873985 ], 0.000001);
E0 = ellipsoid([ 0.0000000000000000 0.0000000000000000 ; 0.0000000000000000 0.0000000000000000 ], [ 1.0986933635979599 ; -1.9884387759871638 ], 0.000001);

assert(aux_tryPlot(E1));
assert(aux_tryPlot(Ed1));
assert(aux_tryPlot(E0));

% test completed
res = true;

end


% Auxiliary functions -----------------------------------------------------

function res = aux_tryPlot(E)

res = true;
try
    % try all variations in plotting
    h = figure;
    
    % one argument: object
    plotRandPoint(E);

    % two arguments: object and dimension
    plotRandPoint(E,[1,2]);
    
    % three arguments: object, dimensions, number
    plotRandPoint(E,[1,2],50);
    
    % four arguments: object, dimensions, number, linespec, NVpairs
    plotRandPoint(E,[1,2],50,'.b');
    
    % close figure
    close(h);
catch ME
    close;
    rethrow(ME)
end

end

% ------------------------------ END OF CODE ------------------------------
