Questions tagged [unit-tests]
Unit testing is a method by which individual units of source code are tested to determine if they are fit for use. A unit is the smallest testable part of an application.
236
questions
0
votes
0
answers
34
views
Increase the test performance avoiding the use of mock.create_autospec()
I have created a class called RedisCliWrapper where I have written many methods that call methods of the class redis.Redis. Below I show the class with only the method get_hgetall_value(), which is ...
-1
votes
1
answer
35
views
Unit Test Guidance for Selenium Web Scraping
I'm working through https://www.obeythetestinggoat.com/ and trying to connect the concepts to a program I'm writing.
Specifically, I want to write some unit tests, but I'm having trouble thinking of ...
3
votes
5
answers
131
views
How can I get enough time for unit testing as a developer
I'm always being pushed for feature development and then held to dates that don't give enough time for writing unit tests.
What practices can I use to be a better advocate for getting unit tests ...
0
votes
1
answer
44
views
Automatically testing for typical edge cases?
I want to set up automated testing on my UI components. For anything that renders textual data (i.e. strings or numbers), I would like to automatically test for typical edge cases, such as:
Very long ...
0
votes
0
answers
424
views
Postman - Compare response body with database data
Request Body:
{
"StudentInfo":{
"Student":[
{
"StudentId":"001"
}
}
}
Response Body
{
"Studentinfo":{
"Student&...
1
vote
1
answer
47
views
Should I write redundant unit tests for property setters/getters?
Given: I have a policy of writing thorough, automated unit tests for every externally visible element of an application/system.
Given: I have an API that includes accessors for a property.
The ...
-1
votes
1
answer
61
views
Unit Tests or Integration Tests for validating file contents
I have a Node.js application, and it already has Unit Tests and is using the Mocha framework for the same. It is checking the functions individually. These tests are integrated into the CI/CD pipeline ...
0
votes
0
answers
317
views
How to test RobotFramework test library using mock objects
I have created a RobotFramework test library in Python. It internally utilizes paramiko and paramiko-expect packages to connect to various *nix hosts and execute Unix commands.
I have been reading ...
0
votes
0
answers
19
views
How can I check the value of object parameter inside StatusCode response?
Assume we have:
return StatusCode(500, new { message= "ApplicationSettings is Null!" });
Now I want to check the message value inside my unit test. How should I do it?
1
vote
4
answers
149
views
Is software unit testing with tools considered manual or automated?
I'm quite new to software testing.
I was studying about it and I've read testing can be either manual or automated.
So is unit testing with tools (e.g. unittest or pytest in python) considered manual ...
2
votes
2
answers
58
views
Unit testing for a non-atomic function if all atomic components have been tested
I am writing a module and I have a question about the best way to test a "non-atomic" function. My problem is that I am not sure how much and what specifically I should test because it being ...
1
vote
1
answer
419
views
Unit testing function that reads from pdf - Having dedicated external files?
I am relatively new to automated testing and although I understand the basics to be able to "do it" I don't know much about what are best practices and why.
Specifically I am trying to ...
0
votes
1
answer
470
views
How to write shim for ExecuteReaderAsync?
I have the following method and want to write shim for the needed functionalities in it include ExecuteReaderAsync:
public async Task<IEnumerable<ApplicationSetting>> LoadSettingsAsync(...
1
vote
0
answers
46
views
Delineating unit tests and integration tests in Testing Library for React and unittest
This question is related to Testing Library for React and unittest for Python.
I'd like like to have a single file that contains unit tests and integration tests for a component, and be able to target ...
3
votes
1
answer
217
views
In unit tests, should I check all null and invalid child properties in the input arguments that cause error and force developers too?
In a large application, I have a lot of methods with input arguments that each argument is a model with nested models (as you see in the image).
You see that I have written some conditional codes and ...