MatrixBerryCore
SuiteSecBasic.m
Go to the documentation of this file.
1 classdef SuiteSecBasic < matlab.unittest.TestCase
2  methods
3  function self = SuiteSecBasic(varargin)
4  self = self@matlab.unittest.TestCase(varargin{:});
5  end
6  end
7  methods (Test)
8  %
9  function testMapAutoKey(self)
10  c=mxberry.core.cont.MapAutoKey(...
11  'directPrefix','EE','autoPrefix','ZZZ');
12  %
13  c.putDirect('a',2);
14  c.putDirect('b',3);
15  c.putDirect('cc',4);
16  c.putAuto(333);
17  c.putAuto(33);
18  keyList=c.keys;
19  valueList=c.values;
20  self.verifyTrue(isequal(keyList,...
21  {'EEa','EEb','EEcc','ZZZ1','ZZZ2'}));
22  self.verifyTrue(isequal(valueList,{2,3,4,333,33}));
23  self.verifyTrue(isequal(333,c.get('ZZZ1')));
24  self.verifyTrue(isequal(3,c.get('EEb')));
25  c.remove({'EEb','ZZZ1'});
26  keyList=c.keys;
27  valueList=c.values;
28  %
29  self.verifyTrue(isequal(keyList,...
30  {'EEa','EEcc','ZZZ2'}));
31  self.verifyTrue(isequal(valueList,{2,4,33}));
32  end
33  end
34 end