Skip to content

Commit 697ffae

Browse files
committed
Updated tests to use convenience class Testable
1 parent 01e5297 commit 697ffae

File tree

7 files changed

+20
-10
lines changed

7 files changed

+20
-10
lines changed

code/Controller.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33

44
% Copyright 2021-2025 The MathWorks, Inc.
55

6-
properties ( GetAccess = ?matlab.unittest.TestCase, ...
7-
SetAccess = private )
6+
properties ( GetAccess = ?Testable, SetAccess = private )
87
% Push button for generating new data.
98
Button(:, 1) matlab.ui.control.Button {mustBeScalarOrEmpty}
10-
end % properties ( GetAccess = ?matlab.unittest.TestCase, ...
11-
% SetAccess = private )
9+
end % properties ( GetAccess = ?Testable, SetAccess = private )
1210

1311
methods
1412

code/View.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010
LineColor {validatecolor} = "k"
1111
end % properties
1212

13-
properties ( GetAccess = ?matlab.unittest.TestCase, ...
14-
SetAccess = private )
13+
properties ( GetAccess = ?Testable, SetAccess = private )
1514
% Line object used to visualize the model data.
1615
Line(:, 1) matlab.graphics.primitive.Line {mustBeScalarOrEmpty}
17-
end % properties ( GetAccess = ?matlab.unittest.TestCase, ...
18-
% SetAccess = private )
16+
end % properties ( GetAccess = ?Testable, SetAccess = private )
1917

2018
properties ( Access = private )
2119
% Listener object used to respond dynamically to model events.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Info>
3+
<Category UUID="FileClassCategory">
4+
<Label UUID="test"/>
5+
</Category>
6+
</Info>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Info location="Testable.m" type="File"/>

tests/Testable.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
classdef Testable < matlab.uitest.TestCase
2+
%TESTABLE Convenience class used for testing purposes.
3+
4+
% Copyright 2025 The MathWorks, Inc.
5+
6+
end % classdef

tests/tApp.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
classdef ( TestTags = ["system", "ui"] ) tApp < matlab.uitest.TestCase
1+
classdef ( TestTags = ["system", "ui"] ) tApp < Testable
22
%TAPP System-level test for the entire application.
33

44
% Copyright 2025 The MathWorks, Inc.

tests/tComponent.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
classdef ( Abstract, TestTags = "ui" ) tComponent < matlab.uitest.TestCase
1+
classdef ( Abstract, TestTags = "ui" ) tComponent < Testable
22
%TCOMPONENT Common test infrastructure for views and controllers in the
33
%simple MVC application.
44

0 commit comments

Comments
 (0)