MatrixBerryCore
StructChangeTrackerTC.m
Go to the documentation of this file.
1 classdef StructChangeTrackerTC < matlab.unittest.TestCase
2  properties
3  tracker
4  end
5  methods (TestMethodSetup)
6  function self = setUp(self)
7  self.tracker=mxberry.core.struct.test.StructChangeTrackerTest();
8  end
9  end
10  methods
11  function self = StructChangeTrackerTC(varargin)
12  self = self@matlab.unittest.TestCase(varargin{:});
13  end
14  end
15  methods (Test)
16  function self = test_simple_patch(self)
17  SRes=self.tracker.applyPatches(struct(),0,1);
18  self.verifyEqual(SRes.alpha,1);
19  %
20  SRes=self.tracker.applyPatches(struct(),0,2);
21  self.verifyEqual(SRes.beta,3);
22  self.verifyEqual(SRes.alpha,1);
23  %
24  SRes=self.tracker.applyPatches(struct(),0,103);
25  self.verifyEqual(SRes.beta,2);
26  SResInf=self.tracker.applyPatches(struct(),-inf,inf);
27  self.verifyEqual(true,isequal(SRes,SResInf));
28  end
29  end
30 end