Most voted "unit-testing" questions
Unit testing or unit testing is a method by which individual source code units, assemblies of one or more computer program modules, together with associated control data, operating procedures and operating procedures, are tested to determine if they are fit for use.
Learn more…165 questions
Sort by count of
-
0
votes1
answer23
viewsERROR Nullinjectorerror: R3injectorerror(Dynamictestmodule)[Kdsdialogservice -> Matdialog -> Matdialog]: Nullinjectorerror: No Provider for Matdialog
I am doing unit testing in an application of mine. I am beginner regarding testing, so I need your help. In my application I do a service using Matdialog ( Kdsdialogservice). I have tried putting…
-
0
votes0
answers16
views--findRelatedTests does not work
I’m trying to use the --findRelatedTests to run pre-commit tests using lint-staged, but the following error always happens The --findRelatedTests option requires file paths to be specified. Example…
-
-1
votes1
answer34
viewsHow to pass a url to a server in java
I’m auditioning for my college project, and I’m having a problem. I create an object and pass all its data through the Tter and the constructor. When I call Service with the save method, it returns…
-
-1
votes1
answer126
viewsandroid - Unit testing and UI testing
Good morning friends, lately I have seen some videos and blogs on the subject, and wanted to know who usually works with tests if it is really worth using tests on Android dev. And if so, which…
-
-1
votes1
answer29
viewsException in Selenium Webdriver c#
Hello, I’m having trouble at this point: Openqa.Selenium.Nosuchelementexception: 'no such element: Unable to locate element: {"method":"link text","selector":"Issue Payment Guide (DAS)"} (Session…
-
-1
votes0
answers36
viewssingle tests on Ode with jest doubt expect
What should I put on expect to check if the product has been deleted once it returns nothing? it('should be able to delete a product.', async () => { const product = await…
-
-1
votes0
answers8
viewsHow to do Junit in this method?
I’m learning Junit and I’m trying to test the toString method, but I can’t do it. I would like the help to understand where and how I should begin. Follows code below public String toString(){…
-
-1
votes1
answer415
viewsUnit test of an SQL query in Junit
I need some help to do the unit test on Junit. How to do the @Test method below: public static StringBuilder findSQLPA() { StringBuilder sql = new StringBuilder(); sql.append(" select…
-
-1
votes1
answer144
viewsPrivate unit attribute test of a class / C#
I’m trying to create a unit test to ensure that an attribute of an X class is actually changed. But to compare it at the end of my test, something like: Assert.Equal(_sampleClass.Email, mockEmail);…
-
-1
votes1
answer98
viewsFunction returning only one value
I am making a program in Python and need to implement a function. The function receives as input two parameters: A dictionary containing as key the name of an employee and as value a list containing…
-
-1
votes0
answers8
viewsasynchronous import to jest.mock to keep the simulation file separate and reusable for other tests
I am trying to make an import into my play simulation to use a separate file to play the same simulation in multiple codes. Simulation below: const listCache: Array = []; jest.mock('aws-sdk', ()…
-
-2
votes1
answer658
viewsHow to mock a private function in Junit
I have a main class Usuario extending (extends) an abstract class called Sessao, and uses a function of Sessao calling for obterDados() that takes session data and returns to an object SessaoTO. I…
-
-2
votes1
answer100
viewsJasmine error - Uncaught [Object Object] thrown
When I run my test I get the following error Uncaught [object Object] thrown Every time the test is run he says the error is in a different location, I can’t understand the reason. Sometimes the…
-
-2
votes1
answer14
viewsTesting of a component function
I don’t understand how I could test this function of Component, I’ve tried some ways, but I really didn’t understand how to do Function in the Component: openModal(){ if(this.RecommendationCount…
-
-3
votes1
answer745
viewsI’m not getting a unit test
I have a problem to do a test method in this JAVA program. The method I devised was to verify that the wolf is dead. @Test public void verificaSeOLoboMorreAposCompletarAIdade(){ campo = new…