%% Test Output of a Function
% Use verifyClass to test the class of the output of a function.
% In a file in your current folder, create the add5 function. The function accepts a numeric input and increments it by five.
% function y = add5(x)
% % add5 - Increment input by 5
% if ~isa(x,"numeric")
%     error("add5:InputMustBeNumeric","Input must be numeric.")
% end
% y = x + 5;
% end
% Call the function with a valid input.

actual = add5(1);

% Create a test case for interactive testing, and then verify that the class of actual is double.

testCase = matlab.unittest.TestCase.forInteractiveUse;
verifyClass(testCase,actual,?double)

% Copyright 2012 The MathWorks, Inc.