Questions tagged as 'pruebas-unitarias'

1
answer

Pass a unit test of views based on Django classes

I'm adding unit tests to my blog and I can not pass the test that should happen . The test is this: from django.test import TestCase from django.urls import resolve from apps.blog.views import EntryList class ApiRootTest(TestCase): de...
asked by 06.08.2017 / 00:46
1
answer

$ is undefined in unit test mocha

I am using mocha to perform my unit tests of the web layer, and it generates the error:    $ is not defined Can I be missing something else to recognize the $ of jQuery ? The code of my test is: var assert = requi...
asked by 02.01.2017 / 21:34
1
answer

Mocks vs Stubs in PHPUnit

How can I differentiate in PHPUnit a Stub from a Mock. The Stubs verify status, and only dedicate themselves to returning specific answers when called. The PHPUnit documentation on this is clear and the example is very illustrative: //...
asked by 30.08.2017 / 20:30
1
answer

Run repeated tests reported as different tests

I would like to do unit tests of a function with different expected inputs and outputs. My function is irrelevant, so instead I will use an example function that counts English words with the following cadidata implementation: int countEngl...
asked by 02.06.2017 / 10:35
0
answers

Testing in ASP.NET project?

I have an application in ASP.Net, with web forms, but without any tests, and I would like to do them, now, unit tests would not be worth me since, it has many procedures that use up to 10 different tables with inner join and the paradigm is a mi...
asked by 18.05.2018 / 13:00
0
answers

Unit tests with QUnit

Good afternoon, I am working on a project with Intel XDK and I use javascript functions in html files. I need to perform unit tests to verify that the functions work correctly. I am using Qunit for it and I get an error in the test when looki...
asked by 06.07.2016 / 17:45
2
answers

Using @Mock in Java

When using @Mock my @Test does not work although validating through a simple debug works completely, I do not understand how to use the Mocks and what I am testing is very simple: import org.junit.Test; import org.junit.runner.RunWith; import...
asked by 19.03.2018 / 12:46
2
answers

Perform unit tests on a sealed class that internally contains private classes

I have a class of type sealed that contains some internal private classes with public methods within them. My task is to test the public methods that are within those private classes, but I know in advance that the methods (including t...
asked by 02.11.2017 / 07:30
1
answer

Error in unit tests

I developed a game in Java and I have to do unit tests. I do them and I get an error in the tests but I do not understand why, if the game works as expected. The test code is as follows: package Frames; import org.junit.After; import org.juni...
asked by 25.07.2017 / 06:04
2
answers

Check the new value of a variable in an action

I have the following piece of code from a unit test: [Test] public void ValidCancel_ReturnsSuccess() { // TODO: Rewrite this action to really check the cancel bool cancel; var message = new MessageHubCancellableGenericMessa...
asked by 30.11.2017 / 19:14