Path: news.mathworks.com!not-for-mail
From: "per isakson" <poi.nospam@bimDOTkthDOT.se>
Newsgroups: comp.soft-sys.matlab
Subject: Call all methods of an object
Date: Sun, 18 May 2008 17:21:02 +0000 (UTC)
Organization: KTH
Lines: 31
Message-ID: <g0pohu$sji$1@fred.mathworks.com>
Reply-To: "per isakson" <poi.nospam@bimDOTkthDOT.se>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1211131262 29298 172.30.248.37 (18 May 2008 17:21:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 18 May 2008 17:21:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1670
Xref: news.mathworks.com comp.soft-sys.matlab:469105


The tool for Unit Testing that I use, MUNIT (xtargets), 
doesn't work under R2008a. Now I'm looking for a 
replacement. 

In such a tool one need to run all tests in a file, which 
might be implemented as invoking "all" methods of an 
object. What would be the best way to do that? The feature 
demonstrated by this example looks useful. However, is it 
documented?

/per  

>> dm = DynamicReference2Method;
>> dm.('m1')(3)
Method, m1, running
>> dm.('m2')
Method, m2, running

classdef DynamicReference2Method < handle
   properties
   end
   methods
       function m1( this, ii )
           disp('Method, m1, running')
       end
       function m2( this )
           disp('Method, m2, running')
       end
   end
end