Code covered by the BSD License  

Highlights from
MATLAB xUnit Test Framework

image thumbnail

MATLAB xUnit Test Framework

by

 

31 Jan 2009 (Updated )

MATLAB xUnit is a unit test framework for MATLAB code.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

PassingExceptionTest
% Copyright 2013 The MathWorks, Inc.

classdef PassingExceptionTest < TestCase
   methods
      function self = PassingExceptionTest(methodName)
         self = self@TestCase(methodName);
      end
      
      function testThrowsException(self)
         f = @() error('a:b:c', 'error message');
         assertExceptionThrown(f, 'a:b:c');
      end
   end
end

Contact us