Top "Unit-testing" questions

Unit testing is a method by which individual units of source code are tested to determine if they are fit for use.

How to test code dependent on environment variables using JUnit?

I have a piece of Java code which uses an environment variable and the behaviour of the code depends on …

java unit-testing testing junit environment-variables
C# "internal" access modifier when doing unit testing

I'm new to unit testing and I'm trying to figure out if I should start using more of internal access …

c# .net unit-testing tdd
How do I mock a service that returns promise in AngularJS Jasmine unit test?

I have myService that uses myOtherService, which makes a remote call, returning promise: angular.module('app.myService', ['app.myOtherService']) .factory(…

javascript angularjs unit-testing mocking jasmine
Build Maven Project Without Running Unit Tests

How do you build a Maven project without running unit tests? Currently restructuring some code I have for a Servlet …

unit-testing maven-2
How to capture a list of specific type with mockito

Is there a way to capture a list of specific type using mockitos ArgumentCaptore. This doesn't work: ArgumentCaptor<ArrayList&…

java unit-testing junit mockito
How to create unit tests easily in eclipse

I want to create unit tests easily by just selecting method. Is there a tool in eclipse that does that. …

eclipse unit-testing testing junit
Mock HttpContext.Current in Test Init Method

I'm trying to add unit testing to an ASP.NET MVC application I have built. In my unit tests I …

c# unit-testing mocking httpcontext
How to print to console in pytest?

I'm trying to use TDD (test-driven development) with pytest. pytest will not print to the console when I use print. …

python unit-testing python-2.7 pytest
Example of Mockito's argumentCaptor

Can anyone please provide me an example showing how to use the org.mockito.ArgumentCaptor class and how it is …

java unit-testing junit mockito
Code coverage with Mocha

I am using Mocha for testing my NodeJS application. I am not able to figure out how to use its …

node.js unit-testing code-coverage mocha