Code covered by the BSD License  

Highlights from
mlunit_2008a

image thumbnail
from mlunit_2008a by Christopher
A MATLAB unit test framework supporting new classdef files (r2008a)

FibTestCase
classdef FibTestCase < TestCase

% FIBTESTCASE Example of a simple test case on a user-defined matlab
% function (in this case, the Fibonacci function in fib.m).

    properties
    end

    methods
        function testNull(self)
            self.assertEquals(0, fib(0));
        end

        function testValues(self)
            self.assertEquals(1, fib(1));
            self.assertEquals(1, fib(2));
            self.assertEquals(2, fib(3));
            self.assertEquals(3, fib(4));
            self.assertEquals(5, fib(5));
            self.assertEquals(8, fib(6));
            self.assertEquals(13, fib(7));
            self.assertEquals(21, fib(8));
            self.assertEquals(34, fib(9));
            self.assertEquals(55, fib(10));
        end
    end
end

Contact us