Category "unit-testing"

Mockito Capture argument of a Constructor in mockConstruction

I have the following classes: public class Bar { private final Listener mListener; public Bar(Listener listener) { mListener = listener; } } p

How to mock @Viewchild MatInput in angular unit test cases

I am trying to mock viewchild in my angular test cases. here is my html file <mat-form-field appearance="fill"> <mat-label>Date</mat-label> &l

How to mock jquery global $ with jasmine typescript?

I want to test a method in a service that uses the global $ as jquery reference like this: CLASSES_TO_FIND = ['highlight', 'normal']; fetchHighlightedTags():

Test a decorated function in Python

I have a Python function which is decorated. @retry_if_access_token_expired(app_id) def add_something( self, *, argument1,

how to coverage write file func in java

I made a simple function? to which I give a list of objects and then get their headers (just some strings), then sort and write to a file when i made a test for

Await not returning in SpecFlow async test step

I'm having trouble with some async SpecFlow unit tests where an await is never returning. I think that it is to do with the SpecFlow SynchronizationContext, but

MockMVC - Service method does not appeared to be called, works in postman, responding with null for test

I am trying to test the controller for creating a new league method, but it just returns null, and when I put a system.out.println in the service impl method, i

Kotlin Coroutines Unit Testing

Im trying to test this suspend function: suspend fun <T> getResult(call: suspend () -> Response<T>): Resource<T> { val response = call()

Unit testing with get request

I am trying to create a unit test for one of my api. In the frontend, I send it this way... params = { participants: JSON.stringify(participants), secti

Object not declared in this scope error in cpp?

I'm getting error SPIGtestMain.cpp:"MockObj not declared in this scope" though I've declared it globally in with extern keyword in SPIGtestMain.cpp file. SPIG

Object not declared in this scope error in cpp?

I'm getting error SPIGtestMain.cpp:"MockObj not declared in this scope" though I've declared it globally in with extern keyword in SPIGtestMain.cpp file. SPIG

Karma fails to load test file: "Failed to fetch dynamically imported module"

I'm trying to test my LitElement components with Karma but importing PDF.JS is causing the test file not to be loaded. Example of the LitElement component file

What is the best way to test secure routes on APIs that requires authentication while using Cognito OAuth with MFA?

I am using AWS Cognito with MFA and I can't use an actual user with a session to test the routes in with supertest testcases. What is the best practice for test

How to test a DatePicker component using Jest?

Here is the component to test, its a DatePicker component: import { useState } from 'react'; import { useFormContext } from '../Form'; import Textbox from '../T

What is the easiest way to test multiple versions of a NuGet?

I have two C# projects. Project A is a NuGet package. Project B is a web service. Project A calls the web service. We want B (the web serice) to remain backward

How to test if output function recieved is are correct or not using GTEST/GMOCK

I am trying implemnent the GTEST/GMOCK framework for unittesting the C-code. I am using the MSVS 2017. The adaptation is completed. Here, I have the matlab gene

Moq multiple generics i.e. LoadData<T,U>(string sproc)

I think I'm close, but just can't get the syntax. What am I missing for the Moq on this ? https://dotnetfiddle.net/1RItB5 Method to test public async Task<T&

`Executed 0 tests, with 0 failures (0 unexpected)` when running individual test cases in Xcode

When I run tests in Xcode, as long as I run all the tests collectively they execute normally. However, if I run only one individual test class or one individual

Restore NuGet packages failed for project ... : Could not find a part of the path

I'm trying to run a Unit Test project in Visual Studio (.NET Framework 4.72). The project is now building/running successfully, however there is still an error

How do you test a form upon the submission addEventListener with jest without a framework only vanilla JS

Most of the research I have done in regards to jest testing unit testing and/or integration testing is all heavily geared towards React. But I am not using reac