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.

learn more… | top users | synonyms (4)

0
votes
0answers
3 views

TestUnit outdated with Rails 4?

I read that TestUnit was replaced in Ruby 1.9.3 itself with Minitest and that Rails 4 is using MiniTest. Should i move all my testUnit-Tests to Testmini or is this not necessary?
0
votes
0answers
9 views

How to fix “TypeError: httpBackend.when is not a function in …https://waybackassets.bk21.net/test/unit/unittest.js”?

I am having a problem setting up a mock httpBackend. I have looked through the API multiple times and I have setup my code following the same procedure. The unit test that I am trying to run is below: ...
0
votes
0answers
7 views

How can I simulate app restart in unit-testing without having to handle inter-process/AppDomain issues?

How can I simulate app restart in unit-testing without having to handle inter-process/AppDomain issues ? I have unit-test that has to test recovery from restart. How do I do that ?
1
vote
1answer
15 views

UnitTests and iOs : viewDidLoad triggered twice

I am testing the viewDidLoad event on one of my UIViewController. - (void)testMyView { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; ...
0
votes
1answer
10 views

Mock controller action, set Request.InputStream as string

I'm trying to test a controller action that reads JSON from the Request.InputStream and outputs a dynamic. I don't understand what the Mock Request.InputStream type should be. I have tried it as a ...
0
votes
0answers
21 views

Rake test doesn't work

When I type rake test it doesn't do anything. I have to test all files one by one by typing for example: ruby -Itest test/models/post_test.rb I created application with -T flag so it ...
1
vote
1answer
18 views

Why can't I use midge to mock a function that throws using slingshot's throw+

Here's the situation: I'm trying to unit test function A that calls function B. Function B is called in a slingshot try+ block and under certain circumstances it can throw using a slingshot throw+. I ...
0
votes
1answer
70 views

Unit Test SQL Procedure

How do you unit test the following procedure: procedure some_prc as begin select t.a, t.b, t.c, t.d, count(*) from t inner join t1 on t.f1 = t1.f2 group t.a, t.b, t.c, t.d; end; the query ...
0
votes
1answer
21 views

Grails Unit Test doesn't fail

I am trying to perform basic unit test on a Grails domain class. Here is the domain class: class User { String username String password String email static constraints = { ...
1
vote
5answers
67 views

how to break up lines most reasonably, staying “within 80 chars” in python?

Here we have the piece: I am not sure, if I am doing it properly, one line is broken up after "+", the next one is artificially braced by "( )" to be able to break it up. The idea behind the code ...
-1
votes
2answers
82 views

Cannot implicitly convert type void to int [closed]

I'm creating a unit test for an existing project. n1 and n2 are input numbers op is operands in a switch case in the main program The problem is with actual. I cannot match the expected and actual ...
0
votes
1answer
11 views

org.mockito.exceptions.misusing.InvalidUseOfMatchersException for valid expression

I get exception org.mockito.exceptions.misusing.InvalidUseOfMatchersException: Invalid use of argument matchers! 2 matchers expected, 1 recorded: for the line of code ...
0
votes
0answers
13 views

QUnit setup() called for each test before teardown

I'm using QUnit in conjunction with require.js for unit-testing a backbone.js application. All of the tests are asynchronous, using the asyncTest method. I'm using setup and teardown to build and ...
1
vote
0answers
15 views

Maven can't find gwt-test-util.properties

im building a web-application with GWT and Maven. For the unit-tests, i'm using the gwt-test-utils Framework. I tried it as described in the tutorial ...
0
votes
0answers
5 views

Path coverage in visual studio

how to get path coverage [#lines of code / #lines of testcode] in visual studio using API. i want to display this data from all CI build to a dashboard. any idea how to do that? are there any .net ...
0
votes
1answer
33 views

How to write a unit test that checks that pressing the button will cause to calling the proper IBAction?

I need to write a unit test that checks that pressing the button will cause the proper IBAction to be called. Here is my test method: - ...
2
votes
6answers
34 views

What's the difference between using @BeforeClass and using instance or static variable in JUnit 4 Java?

I'm new to unit test. About the purpose of using @Before annotation in JUnit 4. I just don't know the point of using it: public class FoodTestCase { static private Food sandwich; @BeforeClass ...
0
votes
0answers
9 views

Library not found for lgcov

I'm using Xcode 4.6 and I've been writing some Unit Tests for an iOS app. I've tried to do some code coverage following from this tutorial: ...
-1
votes
3answers
38 views

Java: To what extent should we encapsulate our methods and classes?

To what extent should we encapsulate our methods and classes? for example, besides getter and setter, what else non-static methods should be declared as public? And if we declared too many private ...
0
votes
1answer
26 views

Attaching xml files into unit test

On Unit Test project, we use xml files and they are called on the unittest.cs as follows. The xml files are just in the project. If I put the xml files into one folder, then please suggest me the path ...
0
votes
0answers
22 views

Proper workspace organization for unit testing

I'd like to know what is the best way to organize your workspace and more specifically how to setup your unit-test projects (I use google framework) when working with a small group of people so my ...
0
votes
1answer
25 views

Unit test events in VS2012

I'd like to listen for an event from my custom library, and use that as the basis for a unit test passing or failing -> for instance, if I have a login method I'd like to listen for LoginSucceeded or ...
0
votes
0answers
7 views

Testing Facebook enabled IOS App

How does one go about testing an IOS (or Android) app with Facebook without incurring the wrath of Facebook? I have an IOS app that post to Facebook. During the development process it naturally hits ...
1
vote
2answers
34 views

Fluent Assertions: Compare two numeric collections approximately

I have two arrays of double. Is there a way using FluentAssertions to compare the arrays element-by-element, using the .BeApproximately() technique? One range value would suffice for the entire ...
0
votes
0answers
11 views

How to access isolated storage in unit tests without blocking the files when leaving streams opened?

Some of the unit tests of a library I'm working on should access isolated storage¹. Using isolated storage in unit tests has a caveat: the isolation should be only by domain (or assembly). The issue ...
2
votes
1answer
17 views

Why can't I stub this method of GKTurnBasedParticipant using OCMock?

Here is an OCUnit test that simply stubs the method playerID of GKTurnBasedParticipant: #import <GameKit/GameKit.h> #import "OnlineMatchTest.h" #import "OCMock.h" @implementation ...
0
votes
1answer
59 views

how to use LINQ to search for all user names that Starts With (“john”)?

I had a question a couple of days ago about asking "What is the simplest way to count the number of usernames that starts with "john" my test finds in the MembershipUserCollection? (the test should ...
0
votes
2answers
27 views

How to mock data access in private methods

I would like to ask how can I use rhino mocks with in the next example: Public Class CustomerService { Public void Register() { Action1(); Action2(); } ...
1
vote
0answers
10 views

Testing Form Submission With Third-Party Libraries

I have an HTML form that uses a python backend to send information to a third party service via a urllib request from that service's python library. How would I go about making sure that this request ...
0
votes
0answers
23 views

unit test in zend

I followed the unit test tutorial for Zend :- http://framework.zend.com/manual/2.1/en/tutorials/unittesting.html but I don't understand how to apply it my project. I'am not able to figure out if my ...

1 2 3 4 5 621
15 30 50 per page