統計
All
Feeds
回答済み
How to generate code coverage and cobertura test reports for the same source code in R2022b
Hi Alexander, In releases prior to R2022a, running tests with more than one code coverage plugin added to the TestRunner could ...
How to generate code coverage and cobertura test reports for the same source code in R2022b
Hi Alexander, In releases prior to R2022a, running tests with more than one code coverage plugin added to the TestRunner could ...
1年以上 前 | 0
| 採用済み
回答済み
how to customize unittest report name
Hi Chetan, There is currently no way to change the title in the test report, but we've taken note of your request. Are you jus...
how to customize unittest report name
Hi Chetan, There is currently no way to change the title in the test report, but we've taken note of your request. Are you jus...
2年以上 前 | 1
| 採用済み
回答済み
Assign value to property of mock object when method is called
If you're using R2018b or later, you can use the Invoke action to set this up. Here's an example: function example import ...
Assign value to property of mock object when method is called
If you're using R2018b or later, you can use the Invoke action to set this up. Here's an example: function example import ...
4年弱 前 | 1
| 採用済み
回答済み
Create a mock with defined behavior on different subsequent method calls
I know this reply is coming very late, but if it's still helpful, this is possible in R2019b using the Invoke action to define m...
Create a mock with defined behavior on different subsequent method calls
I know this reply is coming very late, but if it's still helpful, this is possible in R2019b using the Invoke action to define m...
5年弱 前 | 1
回答済み
unit test mocking framework: verify a method was called in a sequence
I know this reply is coming very late, but in case it's still helpful, this is now possible in R2019b using the Occurred constra...
unit test mocking framework: verify a method was called in a sequence
I know this reply is coming very late, but in case it's still helpful, this is now possible in R2019b using the Occurred constra...
5年弱 前 | 0
回答済み
Unit Test: Write parametrized tests where TestParameters depends on ClassSetupParameters?
Sorry for the long delay in replying! Were you able to find a workaround? The only workaround I can think of is to manually c...
Unit Test: Write parametrized tests where TestParameters depends on ClassSetupParameters?
Sorry for the long delay in replying! Were you able to find a workaround? The only workaround I can think of is to manually c...
6年以上 前 | 0
回答済み
How can I pass values from inside a TestRunner run?
You can use a TestRunnerPlugin to store data from the test run. I've included some example code below to show how this might wor...
How can I pass values from inside a TestRunner run?
You can use a TestRunnerPlugin to store data from the test run. I've included some example code below to show how this might wor...
6年以上 前 | 0
| 採用済み
解決済み
Number of Even Elements in Fibonacci Sequence
Find how many even fibonacci numbers are available in the first d numbers. Consider the following first 14 numbers 1 1 2...
約7年 前
解決済み
The 5th Root
Write a function to find the 5th root of a number. It sounds easy, but the typical functions are not allowed (see the test su...
約7年 前
回答済み
How can I make a mock method return different answers?
Unfortunately, there isn't a clean way to do this. I'll record this question in an enhancement request, though, for consideratio...
How can I make a mock method return different answers?
Unfortunately, there isn't a clean way to do this. I'll record this question in an enhancement request, though, for consideratio...
約7年 前 | 1
| 採用済み
解決済み
Combine the first and last names
MATLAB R2016 provides a rich set of functions to work with string arrays. In this problem, you will be given two string arrays o...
8年弱 前
回答済み
How to use constant property when defining TestParameter in unittest.
This is a bug: https://www.mathworks.com/support/bugreports/1212962 The bug report mentions Static methods but the same is...
How to use constant property when defining TestParameter in unittest.
This is a bug: https://www.mathworks.com/support/bugreports/1212962 The bug report mentions Static methods but the same is...
8年以上 前 | 1
| 採用済み
解決済み
This is a palindrome and so am I
A palindrome is a sequence of characters which reads the same backward or forward, for instance 'a man a plan a canal panama'...
9年以上 前
回答済み
Parameters for Matlab.unittest.TestCase
If you have access to R2014a or later, parameterized testing could still be an option. Parameter values are often hard-coded but...
Parameters for Matlab.unittest.TestCase
If you have access to R2014a or later, parameterized testing could still be an option. Parameter values are often hard-coded but...
10年弱 前 | 2
回答済み
How to perform multiple identical unit tests.
Release 2014a provides another solution that you may want to consider -- writing a parameterized test. Please see <http://www.ma...
How to perform multiple identical unit tests.
Release 2014a provides another solution that you may want to consider -- writing a parameterized test. Please see <http://www.ma...
10年以上 前 | 1
回答済み
Data driven Unit Tests
Another possibility, as of release 2014a, is to write a <http://www.mathworks.com/help/matlab/matlab_prog/create-basic-parameter...
Data driven Unit Tests
Another possibility, as of release 2014a, is to write a <http://www.mathworks.com/help/matlab/matlab_prog/create-basic-parameter...
10年以上 前 | 2
解決済み
Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...
11年弱 前
解決済み
Equilibrium
Is this tower of blocks going to fall? <<http://www.alfnie.com/software/equilibrium02.jpg>> *Description* Given a stack...
11年弱 前
回答済み
How to perform multiple identical unit tests.
Hi Graham, One approach is to define your test content in an abstract base class. The test content would refer to an abstract...
How to perform multiple identical unit tests.
Hi Graham, One approach is to define your test content in an abstract base class. The test content would refer to an abstract...
11年弱 前 | 2
| 採用済み
解決済み
Coin change combinations.
Using only pennies (1), nickels (5), dimes (10), quarters (25), half dollars (50), and dollars (100), how many different combina...
12年弱 前
解決済み
Unique values without using UNIQUE function
You must return unique values in a vector in *stable* mode without using the unique function. About stable order flag: ...
約12年 前
解決済み
Create logical matrix with a specific row and column sums
Given two numbers *|n|* and *|s|*, build an |n-by-n| logical matrix (of only zeros and ones), such that both the row sums and th...
12年以上 前
解決済み
Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times. Examples : n=2, A=[1 2 3] -> [1 1 2 2 3 3] n=0...
12年以上 前
解決済み
Community Problem 500!
In honor of this being the 500th Community problem, see if you can create a function that has a Cody size of 500. It can do any...
12年以上 前
解決済み
Find the sum of the elements in the "second" diagonal
Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.
12年以上 前
解決済み
Set the array elements whose value is 13 to 0
Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...
12年以上 前
解決済み
Convert single-precision floating-point number to binary representation
Write a function which takes a scalar <http://en.wikipedia.org/wiki/Single-precision_floating-point_format single-precision floa...
12年以上 前
解決済み
Multiply 2 numbers
Very easy, you just have to multiply 2 numbers but you cannot use the following signs (*, /, - ,^) ,mtimes , times, cross, pro...
12年以上 前
解決済み
Create a matrix from a cell
In this problem , you must convert a cell into a matrix and pad each cell with NaN. *Example 1:* If you have the input...
12年以上 前
解決済み
Assign numerical values to a structure with 1 field
The aim is to assign values to a multidimensional structure *without using for-loop or while-loop* Example with a structure ...
12年以上 前