MockObject

版本 1.1.0.0 (11.4 KB) 作者: Paul Sexton
A mock object library for MATLAB.
216.0 次下载
更新时间 2021/5/4

编者注: This file was selected as MATLAB Central Pick of the Week

OVERVIEW
I initially wrote MockObject to help me unit test code that connected to hardware devices using COM objects. By swapping in a mock for the actual COM object, I could could simulate any device behavior I wanted.

I've since used it to mock HTTP sessions as well, and it's probably useful wherever you want to mock out Something Big.

FEATURES

The MockObject class has two main features:

* It maintains a lookup table of function return values: for any function, for a specific function, or for a specific function with specific arguments
* It maintains a list of what methods were called, along with the arguments used.

EXAMPLES

See the example subdirectory for an example of how this would work.

REQUIREMENTS

MockObject will _probably_ run on any version of MATLAB back to R2008a. It certainly won't work on anything older, as it uses classdef-based classes.

引用格式

Paul Sexton (2024). MockObject (https://github.com/psexton/MockObject), GitHub. 检索时间: .

MATLAB 版本兼容性
创建方式 R2011a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Call Web Services from MATLAB Using HTTP 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

无法下载基于 GitHub 默认分支的版本

版本 已发布 发行说明
1.1.0.0

Changing file link to point to the github repo.

1.0.0.0

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库