view m-toolbox/classes/tests/@ltpda_uoh_tests/test_history_setName.m @ 2:18e956c96a1b
database-connection-manager
Add LTPDADatabaseConnectionManager implementation. Matlab code
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Sun, 04 Dec 2011 21:23:09 +0100 (2011-12-04)
parents
f0afece42f48
children
line source
+ − % Tests on the history field when doing an operation like setName.
+ − function res = test_history_setName(varargin)
+ −
+ − res = '';
+ − utp = varargin{1};
+ −
+ − if ~isempty(utp.className)
+ − % empty constructor
+ − obj = feval(utp.className);
+ − aName = 'my object';
+ − obj.setName(aName);
+ −
+ − h = obj.hist;
+ −
+ − % minfo
+ − ii = h.methodInfo;
+ − assert(strcmp(ii.mname, 'setName'), 'The method name in methodInfo was not %s', 'setName');
+ − assert(strcmp(ii.mclass, 'ltpda_uo'), 'The class in methodInfo was not %s', 'ltpda_uo');
+ −
+ − % plist
+ − pl = h.plistUsed;
+ − assert(strcmp(pl.find('name'), aName), 'The name in plistUsed was not %s', aName);
+ −
+ − res = sprintf('%s history works when calling setName', class(obj));
+ − end
+ −
+ − end