Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
86 views

Say, I have an abstract class for testing. abstract class BaseEntity<SELF extends BaseEntity<SELF>> { } I declared an abstract test class for testing subclasses of the BaseEntity. ...
Jin Kwon's user avatar
  • 22.4k
0 votes
1 answer
196 views

I want to repeatedly execute the following test class: class Test { static Foo foo; @BeforeAll static void setUpAll() { foo = generateRandomFoo(); } @ParameterizedTest ...
Борат Сагдиев's user avatar
0 votes
1 answer
52 views

I have the following JUnit parameterized test case which uses an aggregator as well as a directly bonded argument. When I run it, I get the following error: ParameterResolutionException: No ...
Silas_229's user avatar
1 vote
2 answers
790 views

I have a Junit5 parameterised test method and I need to use my custom DataProvider class with methods that return Stream<Arguments> and are supposed to pass all their arguments to this test ...
Alexander Asmer's user avatar
1 vote
2 answers
432 views

I try to write a test that looks like this: private static readonly IEnumerable<MyEnumType> ListOfEnumValues = Enum.GetValues(typeof(MyEnumType)).Cast<DocumentType>(); private static ...
MrMaavin's user avatar
  • 1,757
0 votes
1 answer
121 views

Background: https://github.com/sageserpent-open/americium/issues/69 https://github.com/sageserpent-open/americium/issues/66 These concern an extension that generates test data for a JUnit5 test, ...
Gerard Murphy's user avatar
0 votes
0 answers
443 views

Starting from the following generic code, showing a sample test class that needs to be executed for several rounds of input data: import java.util.stream.Stream; import org.junit.jupiter.api.*; import ...
Serban's user avatar
  • 852
0 votes
0 answers
88 views

I do want to create test data in the beforeEach method and access that data to give to the parameterized test but I get an error TS2454: Variable  testData  is used before being assigned. describe('...
Teharez's user avatar
  • 615
1 vote
1 answer
292 views

I'm trying to write a parameterized test based on some string values using the Criterion framework. As an MRE, and following the example shown in the docs, I wrote the following: #include <...
Mehdi Charife's user avatar
2 votes
0 answers
389 views

I have two different sets of parameter sources for a parameterized test (set 1 being a subset of set 2). Depending on JUnit5 tags I want to execute the same test method either against set 1 or set 2. ...
Konrad Windszus's user avatar
0 votes
0 answers
29 views

describe('', () => { let ids = []; before('',() => { cypress.api('GET', 'http://localhost:3000/api/id-list').then((response) => { response.body.foreach((id) => { ...
Jayanath's user avatar
0 votes
1 answer
148 views

In the below script i would like to parametrize functions call RegisterClientCabinMovementDetection(x) and RegisterClientOccupantInSeatDetection(x) (made bold in script)so on... is there any way to ...
SATHISH BABU's user avatar
4 votes
2 answers
6k views

I have the following parameterized JUnit5 test that is supposed to take input data from the method testData import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.JWSHeader; import com....
ScrewTheWest's user avatar
0 votes
1 answer
65 views

I'm trying to create a fixture that has dependencies on other fixtures and is also parameterized. Example: @pytest.fixture(scope="module") def fix1(): ... @pytest.fixture(scope="...
Nima Rahnema's user avatar
1 vote
1 answer
1k views

First of all sorry in advance if I'm doing this wrong, this is my first question asked on stackoverflow. So please let me know if my formulation is off. So I'm working on a project where I want to ...
gigibeau's user avatar
0 votes
1 answer
517 views

I use this in my MyService.kt. The useXml is read via application.yml and application-test.yml @Service class MyService ( @Value("\${something.use-xml}") var useXml: Boolean = false )...
Joergi's user avatar
  • 1,611
1 vote
1 answer
731 views

I have a source file util.py and there I have below one, where day is an AWS lambda environment variable. import os day = os.getenv("DAY") def get_day_code(): if day == "Monday&...
Praveen's user avatar
  • 31
0 votes
2 answers
74 views

I have a list of dicts defined in setUpClass in a Django TestCase: class MyTest(TestCase): @classmethod def setUpClass(cls): myobj = MyModel.objects.create() cls.MY_LIST = [ ...
alias51's user avatar
  • 8,718
-1 votes
1 answer
555 views

I have below maven java projects: com.validator com.demoModel1 com.demoModel2 Validator project contains the validation code and the jar is used by demoModel1 and demoModel2 projects to perform ...
Priom Biswas's user avatar
0 votes
1 answer
1k views

I have created below JUnit5 parameterized test with ArgumentsSource for loading arguments for the test: public class DemoModelValidationTest { public ParamsProvider paramsProvider; public ...
Priom Biswas's user avatar
2 votes
1 answer
6k views

I have many boolean methods like boolean isPalindrome(String txt) to test. At the moment I test each of these methods with two parameterised tests, one for true results and one for false results: @...
halloleo's user avatar
  • 10.8k
2 votes
1 answer
1k views

I would like to be able to parameterize my tests for various types through the following code snippet: template <typename T> class MyTestSuite : public testing::TestWithParam<tuple<T, ...
khteh's user avatar
  • 4,280
0 votes
1 answer
454 views

The problem is my input to the program is of integer data type and the output is of double data type.So,while writing parameterized JUnit test cases,assertEquals gets striked off automatically......
Julie's user avatar
  • 1
0 votes
1 answer
556 views

I get some parameters from command lines. Then I want to use these parameters as variables in test cases. I want to use parametrised test in same test case. Is it correct to run it as below? conftest....
ibra's user avatar
  • 11
5 votes
1 answer
3k views

My code: import unittest class MyTestCase(unittest.TestCase): def setUp(self): print("setUp") def tearDown(self): print("tearDown") def ...
Searene's user avatar
  • 27.9k
1 vote
1 answer
1k views

I have one parametrized Junit test in my class. If I initialize all objects used in this test in @Before method they are not accessible in this parametrized Junit test and it throws NUllPointer ...
Umair's user avatar
  • 725
3 votes
2 answers
2k views

Here is an example of Parameterized test in JUnit 5. @ParameterizedTest @MethodSource("generalDataset") fun shouldCreateItem(color: String, size: String) { val item = Item(color, size) ...
diziaq's user avatar
  • 7,905
2 votes
2 answers
4k views

I have a map of key and values and I want to add the keys as array to ValueSource but I've got error.Where am I wrong? Here's my code private val id = mapOf("abc" to 10001,"def" ...
24t7it3's user avatar
  • 23
3 votes
1 answer
5k views

I am trying to parametrize unit tests in Python using parameterize library and unittest framework. I need to patch certain functions and I use the following which works @parameterized.expand([ [a1,...
Ajx's user avatar
  • 343
2 votes
1 answer
1k views

MyBaseIntegrationTestCase is a class, which is a parent for ~ 150 test classes. Now, I want to make MyBaseIntegrationTestCase parameterized (parameter is version of external software) So, I change it ...
Alexander Bubenchikov's user avatar
0 votes
0 answers
362 views

I try to run my tests with jUnit5 annotation @ParametrizedTest in parallel execution, but it's not work. public class Simple { @Inject private WebSteps WebSteps; @Inject private DbSteps dbSteps; ...
grav's user avatar
  • 11
3 votes
3 answers
6k views

I've the following tests: @pytest.mark.parametrize( "nums", [[3, 1, 5, 4, 2], [2, 6, 4, 3, 1, 5], [1, 5, 6, 4, 3, 2]] ) def test_cyclic_sort(nums): pass @pytest.mark.parametrize( ...
Abhijit Sarkar's user avatar
2 votes
1 answer
525 views

@RunWith(value = Parameterized::class) class A(private val a: aa, private val b: bb, private val c: cc, private val d: dd ) : UIAutomatorTestCase() { @Test fun ...
Shah's user avatar
  • 563
2 votes
1 answer
2k views

I have to test android application written in Kotlin. I tried @RunWith(RobolectricTestRunner::class) public class GeoWindowTest { @RunWith(Parameterized::class) class ...
Mahriban's user avatar
0 votes
0 answers
146 views

I am developing an android with Junit5 and Mockito. Some tests are ParameterizedTest and others are just Test. Here is my sample code. When I run this test, only "ParameterizedTests" run. &...
dev.farmer's user avatar
  • 2,861
5 votes
2 answers
8k views

I am trying to pass in an array for testing a certain algorithm, but the arrays seem to not be passed correctly or at all. I manually tested the algorithm so I know it works as it's supposed to. How ...
Noah Iarrobino's user avatar
9 votes
1 answer
3k views

I am trying to write a test with JUnit 5 which should test multiple combinations of some parameters. Essentially I want to test some cartesian product of inputs from different sources. Consider the ...
Madjosz's user avatar
  • 549
1 vote
1 answer
1k views

I'm trying to write a test suite for verifying the state of some servers using testinfra. It's my first time working with python/testinfra/pytest. As a brief pseudocodey example test_files.py ...
granthouston44's user avatar
0 votes
1 answer
3k views

I can really use some help with this parameterized test case I am trying to create. No matter what kind of constructor I create the IDE gives an error message. Here is my code: @RunWith(Parameterized....
Shahin's user avatar
  • 53
29 votes
3 answers
25k views

I am using JUnit 5 as my Test Runner. In the setup method, I have hardcoded 3 params (platformName, platformVersion, and deviceName). I have a test method that should test on various combinations... ...
cpro's user avatar
  • 305
2 votes
1 answer
630 views

I want to write a ParameterizedTest that facilitates a MethodSource to generate a sequence of random values. Now I'm wondering, if there is any declarative approach to limit the number of tests run. @...
Sebastian S's user avatar
  • 4,762
9 votes
2 answers
8k views

I am trying to avoid repeating too much boilerplate in my tests, and I want to rewrite them in a more structured way. Let's say that I have two different parsers that both can parse a text into a doc. ...
Bram Vanroy's user avatar
  • 28.8k
1 vote
0 answers
2k views

I am using the @pytest.mark.parametrizefunctionality to test multiple test cases using pytest. Now I am having a hard time understanding how do I test if my function throws a KeyError by default, how ...
Samarth's user avatar
  • 252
0 votes
1 answer
1k views

I have a parameterized JUnit 5 test, e.g. @EnumSource(Mode.class) @ParameterizedTest void shouldRunWithMode(Mode mode) { ... I want to exclude one of the enum cases from running in Maven, as ...
rü-'s user avatar
  • 2,342
4 votes
1 answer
1k views

If expected variable is integer, it simply goes like this [DataRow(2)] [TestMethod] public void TestMethod(int expected) { // some code... } But what should one do when there is 2d array int[,] ...
Andrey's user avatar
  • 75
1 vote
1 answer
2k views

So, I have a method that takes an Object parameter and depending on its value invokes different methods (I use just if statements instead of switch). public class ClassToTest { public void ...
Alish_strong's user avatar
84 votes
4 answers
77k views

I have a bunch of @ParameterizedTests that receive parameters from a @MethodSource with quite verbose toString() results (e.g. Selenium's WebDriver). These are used per default to compose the ...
beatngu13's user avatar
  • 9,983
2 votes
0 answers
148 views

I have a parameterized test: test.each([myObjWithMyPropertyTrue, myObjWithMyPropertyFalse]) ('should do something when %o', (myObj) => { but instead of printing the entire object with %o, I want ...
eriksmith200's user avatar
  • 2,189
1 vote
1 answer
1k views

I'm writing a parameterized unit test for a code something similar to below, to make sure that my tests cover all the possible input cases and the system behaves as expected. I came up with 3 ...
canan's user avatar
  • 63
0 votes
1 answer
131 views

I am trying to run a basic unit test on Python 2.6 that takes arguments with argparse. I am limited in my environment and cannot install any further libraries or use any modules for testing but ...
Gavin Jones's user avatar