MATLAB单元测试:插件扩展与并行测试实践
1. 向测试运行器添加插件
在MATLAB中,我们可以向测试运行器添加插件以获取更多的测试信息。以 matlab.unittest.plugins.TestRunProgressPlugin 为例,它可以显示测试用例的进度消息。以下是具体的操作步骤:
1. 创建 BankAccount 类 :在工作文件夹中创建 BankAccount.m 文件,代码如下:
classdef BankAccount < handle
properties (Access = ?AccountManager)
AccountStatus = 'open';
end
properties (SetAccess = private)
AccountNumber
AccountBalance
end
properties (Transient)
AccountListener
end
events
InsufficientFunds
end
methods
function BA = BankAccount(accNum,initBal)
BA.AccountNumber = accNum;
BA.AccountBalance = initBal;
BA.AccountListener = Acco
超级会员免费看
订阅专栏 解锁全文
9482

被折叠的 条评论
为什么被折叠?



