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

testIsSetUpString
function test_suite = testIsSetUpString
%testIsSetUpString Unit tests for isSetUpString

%   Steven L. Eddins
%   Copyright 2008 The MathWorks, Inc.

initTestSuite;

function testOneStringIs
assertTrue(xunit.utils.isSetUpString('setup'));
assertTrue(xunit.utils.isSetUpString('setUp_fixture'));

function testOneStringIsNot
assertFalse(xunit.utils.isSetUpString('bogus'));

function testCellArray
strs = {'setup', 'bogus'};
assertEqual(xunit.utils.isSetUpString(strs), [true false]);
assertEqual(xunit.utils.isSetUpString(strs'), [true; false]);

Contact us