Unit testing is a method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine if they are fit for use.
-3
votes
0answers
14 views
Re: password-based encryption. Is it possible to decrypt data that was encrypted with a different password?
I'm writing some unit tests and I want to know if I can test that using a cipher with a different password to decrypt something will fail.
0
votes
2answers
26 views
Run As JUnit not appearing in Eclipse - using JUnit4
I'm trying to write JUnit4 tests for my web app, and they had been working fine previously. However, now when I try to run the tests by right clicking the class file -> Run As -> JUnit Test I don't ...
0
votes
1answer
31 views
Is there a better way to provide a helper methods to test a web application than using a single class?
I'm designing UI Tests for a web application with Selenium in JUnit. I have a base test class with something like this from which I inherit my tests:
public class BaseTest {
protected TestSteps ...
0
votes
0answers
25 views
MVC 4: Testing if the controller action is calling the repository method
I'm new to this testing thing.
I have a MVC 4 application, and I want to start testing it.
I first want to test if the Action method in my controller are calling the methods in repository or not.
I ...
2
votes
1answer
15 views
Unit Testing with DB connection throws error when connecting to DB
Every time I try to run a unit test with some test methods, I get a NullReferenceException at the first line of the following :
public DB()
{
this.sqlConnectionString = ...
2
votes
1answer
18 views
NullReferenceException when calling async method of mocked object
I'm trying to unit test the LoginExecute method of the following ViewModel using MOQ
public class LoginViewModel : ViewModelBase, ILoginViewModel
{
INavigationService navigationService;
...
0
votes
0answers
15 views
Running CakePHP unit tests including code coverage in PHPStorm
I've been following this excellent article to set up unit testing my CakePhp application from within PHPStorm. With a few minor tweaks to the test runner, I've finally got it working reasonably well.
...
2
votes
1answer
14 views
YUI.Test assertion doesn't fail when it is in event's callback
I'm using version 3.4.0
I have a strange problem with YUI.Test assertion. Here is the example:
YUI().use('test', 'node', 'node-event-simulate',
function(Y) {
var runner = Y.Test.Runner;
...
0
votes
0answers
15 views
YUI.Test tests stops after ONLY ONE failed assertion
I coming from QUnit background (I've been very happy using it for many years). In my current project YUI is a framework of choice so it was reasonable to use YUI.Test for Unit Testing.
I'm using ...
0
votes
0answers
13 views
Nunit shadow copy dbghelp.dll issue
To ensure that my C# and MC++ application uses a defined version of the dbghelp.dll (from the Debugging Tools) I put it in the appliation directory where all assemblies reside. This works fine on ...
0
votes
2answers
25 views
Running a Test Suite of the same class but with different initial conditions
In JUnit 4, I am looking to write a test suite that is made up of multiple flavors of the same test case, just with different initial conditions on each one. Here is an example:
import java.io.File;
...
0
votes
1answer
17 views
Writing parameterized tests for JUnit, why are two of my parameters “null” when I run my tests?
I'm doing an internship for a webapp security company, and one of my tasks is to write unit tests for files. The file I'm working on right now simply returns a password-based encryption cipher. The ...
0
votes
0answers
7 views
Testing coupled, interdependent units
I am writing a TTD-motived spec for my program. The program is in JavaScript.
As you read this question, I ask that you please keep in mind that the entire motivation here is writing a spec for my ...
0
votes
0answers
5 views
How to unit test if an event performs a segue
How to unit test if an event like touch up inside on a given button would call a specific segue? I know I can call the segue directly and check for the result but I want to test IF the event would ...
1
vote
1answer
47 views
Injecting a mock service into a domain class for a Grails unit test?
I am writing some Spock spec based unit tests under Grails 2.1.1. I'm having trouble getting springSecurityService injected into my domain object that is used by my unit.
This is what I have so far,
...
1
vote
2answers
19 views
Testing scenarios with exponentially growing outcomes
One of the things that really draws me to TDD is the clear development of your spec alongside implementation.
I am seeking to implement a constructor that accepts a configuration object
function ...
1
vote
1answer
27 views
Unit test for MVVM with EntityFramework
I recently started to add unit tests to my application (EF5, MVVM Light, .NET4.5), and Effort works really nice for testing the Model. But I don't really know how to test the ViewModel with the fake ...
0
votes
2answers
18 views
is there any tool to test functional requirements?
is there any tool to test functional requirements?. I know that there is one way, using black box strategy, but is there any tool to do it? The idea is to test CRUD operations over JSF, JMeter helps ...
0
votes
1answer
16 views
Unit testing on Android NDK
How do you run unit tests on Android native code (native C/C++, not Java)? So far I've only found one similar question, and the answer says use junit with JNI, which I don't want to do (adding JNI ...
1
vote
1answer
32 views
EmberJS unit test compared to AngularJS
I’m planning to build what will eventually be a large SPA with lots of data (in a grid).
It seems a good idea to use a MVC framework. I am mainly looking at AngularJS and EmberJS.
There are arguments ...
0
votes
0answers
49 views
Testing how many time a for loop has run
Hi I have a method witch has two for loops.The method looks like this:
public ElearningSessionsDTO FilterElearningSession(IEnumerable<GetELearningSessionsForStudent_Result> eLearningSession)
...
0
votes
1answer
28 views
Robolectric with Gradle: package org.robolectric does not exist
I am trying to run robolectric tests with gradle android build system. I have followed the instructions given here to try to make it work but while running tests using gradle robolectric I am badly ...
1
vote
3answers
23 views
NUnit Theory with an exception
It is a design/pattern I am looking for.
I have a nunit test, in which I plan to use an existing enum as theory. The existing enum has almost 30 members.
Say it's like:
enum ABigEnum
{
A,
...
0
votes
1answer
19 views
Using OCMock on NSOperation gives bad access
I was writing a unit test and it was giving me trouble. Turns out I can reproduce the trouble using just OCMock and normal obj-c. So I am sharing my simple test that reproduces my problem here in the ...
0
votes
0answers
4 views
Generate testcategory based on vsmdi file
I'm upgrading a couple of big solutions from Visual Studio 2010 to Visual Studio 2012. Now I want to delete the .vsmdi files for the unit tests. I want to use the new TestCategory attribute.
Is it ...
0
votes
0answers
16 views
Karma runner console - output only failed tests
This is default output of Karma test runner (with one failed test):
.
..
...
e 28.0 (Windows): Executed 413 of 421 (1 FAILED)
e 28.0 (Windows): Executed 414 of 421 (1 FAILED)
e 28.0 (Windows): ...
0
votes
1answer
18 views
testing database content that was generated by another process
I want to test the content of a database. this might sound stupid but we have a few scenario and this makes sense. For example each morning we receive a file having 100 records an ETL process those ...
-1
votes
1answer
46 views
How do i define Junit Testing without using @Test annotation? [duplicate]
I have a Junit Test file which has more number of methods. usually i perform testing for all the methods using @Test annotation. Now, i don't wish to give @Test annotation in all the methids without ...
0
votes
1answer
10 views
How to automate the uni test code generation in MStest
I am using MSTest to unit test my code. if i want to automate the unit test code for all my public API, how do i do it.
I am using VS 2010 . I am new to MSTest . Can anyone guide me on how to acheive ...
0
votes
1answer
13 views
Testing an outgoing intent
I've been trying to unit test a simple calculator app with ActivityUnitTestCase.
The code for my calculator app
protected void onCreate(Bundle savedInstanceState) {
...
0
votes
1answer
12 views
Running unit tests in VS2012 from network shares / within VM
Running Visual Studio 2012 with Update 3 and ReSharper 7.1.3 running in a VMWare machine with Windows 7 64bit.
When working with projects on network shares or mapped drives I found that the ...
1
vote
1answer
26 views
Redundant methods across several unit tests/classes
Say in the main code, you've got something like this:
MyClass.java
public class MyClass {
public List<Obj1> create(List<ObjA> list) {
return (new ...
1
vote
2answers
58 views
How do I know that my neural network is being trained correctly
I've written an Adaline Neural Network. Everything that I have compiles, so I know that there isn't a problem with what I've written, but how do I know that I have to algorithm correct? When I try ...
0
votes
0answers
18 views
QTAgent32.exe has stopped working
I have a VS2012/.NET4.5 solution with huge number of unit tesks
When running All unit test from solution I am getting rundomly QTAgent32.exe has stopped working error message and unit tests hangs at ...
0
votes
0answers
28 views
Why can't I use the selenium.(etc…) library?
When I try to use the selenium. library to perform commands, they don't work.
I've imported the import com.thoughtworks.selenium.*; library but I get a java: can't find symbol error.
...
0
votes
0answers
18 views
Unit Tests - Referencing 3.0.0.0 MVC, version actually 4.0.0.0
I've googled, however the answers haven't been that helpful for me personally.
I am currently testing SendEmail using Unit Tests (Nunit)
// Arrange
var mockDbContext = new Mock<DbContext>();
...
0
votes
0answers
34 views
Stub protected List in base class for unit-test
I want to test if a method adds a object to a list in the base class.
My problem is that the list is protected so i can´t populate it in my test arrangement. Therefore the list is empty and my method ...
0
votes
0answers
23 views
Event Handling with MSTest Async/Await Testing
I'm writing unit tests using VS2012 for a class that uses async/await pattern on a method. The class also has events which I want to write to the TestContext so they are visible in the test output. ...
0
votes
2answers
34 views
Gradle jacoco code coverage - Then publish/show in Jenkins
I'm trying to setup code coverage for a Java application project.
Project name : NewApp
Project structure:
src/java/** (source code)
src/java-test (unit tests - Jnuit)
test/it-test ...
0
votes
2answers
22 views
Accessing TeamCity test results from script in a subsequent build step
I have a build step that reports the number of run tests to TeamCity.
I would like access this number (and other data) in a subsequent build step, ideally from a python or powershell script.
...
0
votes
1answer
18 views
How can this function be tested with vows?
How can the following function, intended to add routes to express.js app based on an object hierarchy, be tested using vows.js cleanly without breaking vows' separation of the topic and the vow?
var ...
0
votes
0answers
8 views
Any Tool to generate HTML report from google test xml output
I've been searching for a long time any tool that can help me generate a HTML report from the XML report on execution of UTs using google test framework, but couln't find any. Can anybody suggest me a ...
0
votes
1answer
18 views
Wrapping unittest TestCases in Python
Hi I'm trying to tweak Python's standard unittest library to my own needs.
So far everything is experimental and I want to know if I'm doing something wrong, so here is my code:
class Should(object):
...
0
votes
2answers
28 views
Make TeamCity build fail if tests are not run
We have a setup where TeamCity builds the software and the runs the unit tests on it. We use a powershell script inspired by this answer, which runs the unit tests with vstest and reports code ...
0
votes
0answers
22 views
Single JUnit for Multiple Parameters Null Checks when an exception is expected
I am writing unit test cases for my code where I have a method that takes 7 different parameters. The sample method is like below:
public boolean registerUser(String firstName, String lastName, ...
0
votes
0answers
16 views
Entity Framework DropCreateDatabaseAlways + MigrateDatabaseToLatestVersion
I'm writing some integration tests that hit the database and I'm using Entity Framework 5 Code First Migrations
My tests work great when I'm using DropCreateDatabaseAlways. This initializes the ...
2
votes
1answer
27 views
How should unit testing be done for gestures in iOS?
I am confused how unit testing for gestures should be done in iOS. In my application, panning a scrollview triggers an event handler that then does some stuff. When unit testing this am I supposed to:
...
0
votes
0answers
32 views
How to support additional IDbConnection methods in Dapper (using DapperWrapper)?
I'm attempting to create some unit tests for a repository that uses Dapper methods, but I'm having trouble figuring out how to get my code to accept a mocked DbConnection. I found that DapperWrapper ...
0
votes
0answers
12 views
Using Chai to Unit Test a Decorator
I'm using Chai in Python. I have a function, foo, and a decorator, bar.
@bar
def foo():
I want to test that bar is being decorated with foo. Mocking the decorator and adding an expectation ...
3
votes
2answers
36 views
how to do unit test on functions that take active region as input?
For example, here are two versions of function to count the instances of "a" in a region or in a string:
(defun foo (beg end)
(interactive "r")
(let ((count 0))
(save-excursion
(while ...