% testAddVectors.m  test addVectors.m
% R. Waylett for CISC106, sect 80, 10/01/2007

% Test formula to calculate resultant Vector C given Vector A and Vector B

%%%%%%%%%%%%%%%%%%%%%%%
%define the  tolerance%
%%%%%%%%%%%%%%%%%%%%%%%

% since the equation does not use Pi or any type of advaced math the tolerance will be small

tolerance = 0.00001;

%%%%%%%%%%%%%%%
%Run the tests%
%%%%%%%%%%%%%%%

% Test 1

actual = addVectors(1, 23, 4, 2, 5, 0);
expected = [3, 28, 4];


diff = abs(expected - actual);

if (diff < tolerance)
     disp('test 1 passed');
else 
     disp('test 1 failed');
     expected 
     actual
end

% Test 2

actual = addVectors(3, 6, 7, 8, 1, 3);
expected = [11, 7, 10];


diff = abs(expected-actual);

if (diff < tolerance)
   disp('test 2 passed');
else
    disp('test 2 failed');
    expected
    actual
end

% end testVectors.m
