unit-testing Questions

13

Solved

When running JUnit testing , it gave an initializationError: No tests found matching. Like this: prodapi-main-junit initializationError(org.junit.runner.manipulation.Filter) java.lang.Exception: ...
Edme asked 8/12, 2017 at 9:1

3

Solved

I have the following DatabaseFixture which has worked well for all tests I have created up to this point. I use this fixture for integration tests so I can make real assertions on database schema s...
Nomo asked 23/12, 2017 at 17:26

7

Solved

I am starting out with unit testing, I have a method that uses the web.config for a connection string. I was hoping to be able to use [DeploymentItem("web.config")] to get the web config file, ...
Brendabrendan asked 5/2, 2009 at 14:57

10

Solved

Assume I want to unit test a method with this signature: List<MyItem> getMyItems(); Assume MyItem is a Pojo that has many properties, one of which is "name", accessed via getName(). All I...
Longrange asked 28/8, 2012 at 19:43

4

I'm writing tests for airflow dag and running into issue mocking/patching the dag. # dag.py from airflow.models import Variable ENVIRONMENT = Variable.get("environment") # test_dag.py import da...
Accelerometer asked 10/6, 2020 at 23:27

2

Solved

I need to test how some code I wrote will behave when it calls a method on another class multiple times, where one of the calls will cause an exception to be thrown. I am using Mockery to mock the...
Cymbal asked 17/6, 2018 at 22:5

7

Solved

I have a pair of tables with a parent/child relationship - incident and incidentDetails. I have a viewmodel that contains information from both of these tables. And I have a business layer method t...
Recondition asked 27/12, 2013 at 20:51

3

Solved

How to test implementations of Guice AbstractModule in a big project without creating fake implementations? Is it possible to test bind() and inject() methods?
Marcellus asked 3/11, 2014 at 8:14

7

After I run ProjectNameTests.m (empty test file) by doint Product -> Test the project builds successfully, but it throws and gives me the following error: 2016-01-10 11:25:32.677 xctest[66104:5...
Gillies asked 10/1, 2016 at 10:30

1

I'm trying to use the Microsoft's Application Insights JavaScript SDK React Plugin in my React application, and although it's working successfully, I'm having trouble getting my Jest and Enzyme uni...

1

I am writing tests for a webapp that is made in Python3.6/Django 2.0 and I have the following situation: class TestFoo(TestCase): def test_a(self): obj = Foo.objects.create(a = "bar") expectati...
Cursive asked 9/4, 2018 at 7:7

9

Solved

I have added JWT Authentication using Auth0 to my Spring Boot REST API following this example. Now, as expected, my previously working Controller unit tests give a response code of401 Unauthorized ...
Udela asked 29/4, 2020 at 11:19

18

Solved

When I run tests I get this error during database initialization: django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [<ModelState: 'users.GroupProxy'>] This can happen if...

4

Solved

I added a simple unit test to test my string extension. But it fails. What I am I doing wrong here? From what I know XCTAssertEqual is testing value and not the object itself? The third line btw,...
Spleenwort asked 19/10, 2013 at 8:57

5

When writing a unit test in Jest, how can I test that an array contains exactly the expected values in any order? In Chai, I can write: const value = [1, 2, 3]; expect(value).to.have.members([2, ...
Araxes asked 3/5, 2018 at 9:55

4

I want to import certain modules for all testing suits such as ngrx Store, ngx translate or httpClientModule in an [email protected] project with angular 5. in the generated test.ts I have ad...
Callow asked 9/11, 2017 at 14:30

5

Solved

I have a python function foo with a while True loop inside. For background: It is expected do stream info from the web, do some writing and run indefinitely. The asserts test if the writing was do...
Vile asked 9/4, 2020 at 13:34

3

I'm using Django 1.6 with Python 3.3 on Ubuntu 13.10 and Postgres. I have a model User defined as follows: from django.db import models from django.contrib.auth.models import AbstractUser from c...
Neuritis asked 4/12, 2013 at 23:29

9

Solved

I have a JavaScript component in my application that handles infinite scroll pagination, and i'm trying to rewrite it to use the IntersectionObserver, as described here, however I'm having issues i...
Jettiejettison asked 29/5, 2017 at 20:34

2

I am currently trying to develop test-driven with Flutter and Dart. I have an object that has two methods of which the first one does an http call and the second one calls the first method. In ord...
Kickstand asked 27/5, 2020 at 15:42

2

This question is somewhat similar to Mock third party classes (Firebase) in Swift but different enough to warrant a new question, based on the answers to it. I'm trying to mock the Auth/FIRAuth me...
Subjoinder asked 10/2, 2020 at 8:22

9

Solved

How to test specific validation errors in php unit thrown in validation error ? with below code we could check session has errors, but not the exact error $this->assertSessionHasErrors();
Sheffie asked 27/3, 2017 at 8:46

3

Solved

How can I write a parameterized test with two arguments in JUnit 5 jupiter? The following does not work (compile error): @ParameterizedTest @ValueSource(strings = { "a", "b", &q...
Controversy asked 28/4, 2020 at 15:4

4

I am trying to develop a Laravel composer package and run unit tests from within it. After spending the last couple of days reading various outdated and contradictory guides and blogposts, I am com...
Noctambulism asked 2/7, 2017 at 0:30

4

I'm trying to run the following example unit test case class ExampleUnitTest { @Test fun addition_is_Correct() { assertEquals(4, (2 + 2).toLong()) } } but I get the following exception Ex...
Photogene asked 14/5, 2018 at 4:57

© 2022 - 2024 — McMap. All rights reserved.