**TESTING DOCUMENTATION**
This directory contains an automated test suite written for the MATLAB API Client using MATLAB's [unit test framework](https://www.mathworks.com/help/matlab/matlab-unit-test-framework.html), in particular as Class-Based Unit tests to easily share functionality.
If ever needed, the maintainer is welcome to change the tests structure to Function-Based tests or to TestSuite meta-classes instead of TestCase children. Future versions of MATLAB might provide better and easier testing methods.
Directory structure is as follows:
* suites: Test suites
* util: General use classes and methods
Although each test suite inherits from matlab.unittest.TestCase, each is written as a collection of test cases at the integration level. This simplified implementation at the time of this writing since we're testing returned structure instead of values.
**TESTING REQUIREMENTS**
1. MATLAB unit testing framework (usually included)
2. Create a text file named "TOKEN" (no extension) that contains your token. This file will NOT be uploaded to GitHub (due to a .gitignore entry) nor packed into the toolbox (file exclusion) and exists to avoid publishing your token by mistake. If in doubt, clear its contents before publishing changes.
**RUNNING TESTS**
1. IF YOU MADE CODE CHANGES: Uninstall the Onc MATLAB toolkit
1. In MATLAB, open (i.e. Right click -> "Open") the "tests" folder
2. Use MATLAB's command window to run all tests, using the commands described below:
*Running all tests:*
runAllTests
*Running a test suite:*
runTestSuite <NUMBER_OF_TEST_SUITE>
i.e.:
runTestSuite 1
*Running a test case:*
runTestCase <NAME_OF_TEST_SUITE_CLASS> <NAME_OF_CASE_METHOD>
i.e.:
runTestCase Test01_Locations testGetAllLocations
**DEVELOPING TESTS**
New test suite files or new test case methods will be detected by the MATLAB Unit Test framework automatically. In most cases, duplicating an existing suite or case should suffice for starters.
New test suites should be written as classes that inherit from matlab.unittest.TestCase.
New test case methods in a test suite should have the "test" prefix and produce failure conditions as depicted in Mathworks' documentation (i.e. throwing soft failures as explained in https://www.mathworks.com/help/matlab/ref/matlab.unittest.qualifications.verifiable-class.html ).
**CODE DOCUMENTATION**
Code documentation follows the format recognized by MATLAB's "help" and "doc" commands:
- File starts with class title and description
- Class properties have their description comment at the same line
- Methods have their description as the first comment inside their code
Maintainers are free to consider changing this format (i.e. to Doxygen) if the required add-ons are actively maintained and work in all platforms.
没有合适的资源?快使用搜索试试~ 我知道了~
MATLAB通过Oceans 2.0 API访问加拿大海洋网络托管的科学数据.zip
共56个文件
m:51个
md:2个
prj:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 6 浏览量
2024-03-18
16:04:14
上传
评论
收藏 125KB ZIP 举报
温馨提示
1.版本:matlab2014/2019a/2021a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
资源推荐
资源详情
资源评论
收起资源包目录
MATLAB通过Oceans 2.0 API访问加拿大海洋网络托管的科学数据.zip (56个子文件)
MATLAB通过Oceans 2.0 API访问加拿大海洋网络托管的科学数据
logo.png 7KB
onc.prj 6KB
dist
onc-2.1.3.mltbx 46KB
onc
+onc
ProgressBar.m 925B
Service.m 2KB
DPLogger.m 2KB
OncDelivery.m 18KB
OncArchive.m 11KB
OncDiscovery.m 7KB
DataProductFile.m 9KB
OncRealTime.m 5KB
MultiPage.m 10KB
tests
globals.m 552B
runTestSuite.m 871B
runTestCase.m 262B
suites
Test05_Properties.m 3KB
Test07_DataProductDelivery.m 10KB
Test09_ArchiveFiles.m 6KB
Test06_DataProductDiscovery.m 3KB
Test01_Locations.m 3KB
Test03_DeviceCategories.m 3KB
Test08_RealTime.m 5KB
Test04_Devices.m 3KB
Test02_Deployments.m 3KB
runAllTests.m 280B
util
TestDiscovery.m 2KB
verify_has_field.m 242B
verify_error_response.m 300B
verify_downloaded_file.m 253B
verify_field_value_not_empty.m 324B
verify_no_next_page.m 217B
verify_files_in_path.m 320B
verify_fields.m 509B
verify_cell_array_length.m 635B
verify_min_length.m 133B
verify_field_value.m 378B
README.md 3KB
Onc.m 7KB
+ext
ConsoleProgressBar.m 4KB
+util
param.m 1KB
pretty_print.m 3KB
sanitize_filters.m 1KB
format_duration.m 358B
prepare_exception.m 961B
format_size.m 446B
is_failed_response.m 718B
datestring_2_secs.m 226B
print_error.m 1KB
test_url.m 506B
do_request.m 3KB
save_as_file.m 1KB
filter_by_extension.m 1KB
extract_tree.m 5KB
is_relative_path.m 467B
prepare_directory.m 530B
README.md 1KB
共 56 条
- 1
资源评论
Matlab科研辅导帮
- 粉丝: 2w+
- 资源: 7621
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功