Path: news.mathworks.com!not-for-mail
From: "Terral " <terral.jordan@ll.mit.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Mock objects and unit testing
Date: Tue, 10 Feb 2009 20:40:04 +0000 (UTC)
Organization: MIT Lincoln Laboratories
Lines: 3
Message-ID: <gmson4$gsj$1@fred.mathworks.com>
Reply-To: "Terral " <terral.jordan@ll.mit.edu>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1234298404 17299 172.30.248.38 (10 Feb 2009 20:40:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 10 Feb 2009 20:40:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1114402
Xref: news.mathworks.com comp.soft-sys.matlab:517444


, I'm trying to write unit tests for my MATLAB code base. I've written a fair number of classes, and I have a number of them set up with unit tests using mlunit. Unfortunately, it's come time to try and test some of the the inner parts of my object graph, and to try to minimize the dependency of these tests on other objects, I want to mock out some of the objects. 

Unfortunately, it appears the MATLAB does not support private classes. Ideally, I'd be able to write these classes into the same files as the tests I'm writing, since they're (by definition) going to be barebones. Has anybody else done this? If so, how did you do your mocks?