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.

3
votes
2answers
106 views

Testing internal dependencies - inject a mock of itself, or refactor into new class?

I've been given the task of refactoring some legacy code, the main reason is to add unit tests (but I'm a firm believer that testable code is better code, so we're trying to reduce technical debt too)....
3
votes
1answer
89 views

Determine most depended-on code

Another title might be: determine strongest candidates for 100% test coverage. I'm looking for a tool that will display the methods/functions that are most depended on by my code base. To be clear, I'...
0
votes
1answer
43 views

Unit testing for chains of generators in Python

I want to write unit tests for methods that take a generator as input and produce a generator. I am building on this answer. For this question let's take the method: def candidates_for_deletion(self,...
3
votes
0answers
1k views

Get Visual Studio (2013 Community) unit test execution messages

Hi, I'm trying to make "nice" test execution report and get next messages: Message StackTrace Elapsed time Test name and Test Outcome are easily taken as TestContext parameters, for output I'm using ...
1
vote
0answers
29 views

Jasmine, how to test a return?

I'm writing some unit tests for our Angular application. In a few instances, we have some code that is like the following. public submit(): void { if (!this.selectedValue) { ...
1
vote
0answers
38 views

Consumer-driven Contract Testing

I've just come across the term consumer-driven contract testing and, working as a QA, was wondering a few things: 1) what does this actually mean in laymans terms? 2) who would generally execute ...
-1
votes
0answers
25 views

Is it possible to convert trx file to html files inside the azure build pipeline and email it to some one

I have set up a unit test project on azure build pipeline. After the test execution it will generate a trx file. I need to convert that to a nice HTML file using "TrxerConsole.exe" and then need to ...
-1
votes
0answers
21 views

Testing Strategy for Twig template

I am using Drupal 8 CMS for a media platform, which essentially uses twig templating engine. We are using component based approach, building small re-usbale building blocks instead of building the ...
-1
votes
0answers
20 views

How to get AWS authantication token for a unit test

I have some APIs to be test. All the APIs need authantication token need to be pass with the request header. Im using c# to test the above APIs. So, Is there any way to get the AWS user ...