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
1answer
21 views

Is it possible to skip setUp for a specific test in python's unittest?

As for the researchs I made, I believe it's not possible, but none of them was punctual about it. In doing a unittest.TestCase I can define a setUp() function that will run before every test in that ...
1
vote
3answers
29 views

Is it wrong to extend class in order to unit test it's protected property?

I had to make a fix, where the line of code was removed for the second time. So I decided to write a unit test just for that. A Class in its constructor sets a property that I want to test. This ...
0
votes
1answer
19 views

ASP.NET MVC: Trying to test a helper method, but having problems with “resetting” my objects

I am trying to test a helper method using a Test Project in VS2012 Web Express using ASP.NET MVC. I don't want to use my regular database for testing, so I have added the following the App.Config to ...
0
votes
0answers
4 views

JUnit vs TestNg - For a New Project that using Spring MVC

Looking at the latest versions of JUnit[v 4.11] and TestNg[v 6.8.5] as of today, I see no big differences in both the frameworks. If I am using Spring MVC in my project and have several layers and ...
0
votes
0answers
10 views

How to unit test raw input Windows API Messages?

My WPF application is getting the 3DMouse inputs using the RAW INPUT method. So basically I register the raw input device in the main window var hwnd = IntPtr.Zero; var myWin = ...
0
votes
0answers
8 views

Sending NUnit test case inputs to Hexawise (or similar service) via HTTP POST for pairwise analysis

All, I'm trying to build up our pairwise coverage analysis for current and future tests on our project. In particular, we want to make sure that our existing NUnit tests are covering the most ...
2
votes
2answers
21 views

Unit Testing with AOP/PostSharp

I'm trying to use PostSharp to implement a security aspect in order to apply method level authorisation checks in my repository layer. The concept is outlined here. However these authorisation ...
1
vote
1answer
19 views

List untested methods with Visual Studio or ReSharper

Let's just say that once upon a time you had a nice tidy .NET code base with full test coverage, and it's since evolved a bit, and while all the existing tests still pass, there is a fair amount of ...
0
votes
2answers
37 views

Exception thrown during test, leads to Item has already been added in dictionary

Im trying to execute this test method but it throws an exception. AS I step through the code to try to isolate the exception it leads me to: public override MembershipUserCollection ...
1
vote
2answers
41 views

How do I unit test a root ViewModel with multiple layers of children?

I am having difficulty writing tests for a particular ViewModel which ties together several other ViewModels and their children. It's the most complex ViewModel in my application. My ViewModel's ...
0
votes
0answers
24 views

RunWith and ContextConfiguration weird behaviour

I have this very simple class : @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"classpath*:/application-context-this-does-not-exist.xml"}) public class ...
0
votes
0answers
9 views

Dropdown AutoPostBack not firing in Coded UI Tests

I have a asp.net web page with a dropdown that posts back to the server when an item is selected (e.g. AutoPostBack =true). I am using coded ui to create tests. The postback on the dropdown works ...
0
votes
1answer
19 views

How to create a custom UnitTest report in Python?

I'm having some difficulty understanding how I would go about changing a unittest report similar to: ====================================================================== FAIL: test_equal ...
-1
votes
0answers
16 views

Unit testing with Mock

I'm learn to write unit tests I need mock Microsoft.Win32.TaskScheduler. I'm performed "Add Fakes Assembly" operation in VS 2012 and get "Microsoft.Win32.TaskScheduler.fakes". In test code I need ...
0
votes
1answer
24 views

Attribute.IsDefined returns false, Attribute.GetCustomAttribute returns null for defined ActionNameAttribute

I'm trying to set up some unit tests to ensure that URLs will be mapped to the appropriate controllers and actions according to a route-table, and that the target action-method and controller exists ...
0
votes
1answer
14 views

Error when connecting to database in unit test

I am developing an ASP.NET MVC application. The application runs perfectly. I can view, add, update and delete records, but when I run the unit tests, it shows an error on every test method. The ...
0
votes
0answers
9 views

Roboelectric - upgrading from version 1.2 to 2.1

I've inherited an Android application which has unit tests written using Roboelectric version 1.2. I've just replaced the version 1.2 jar with the version 2.1 jar (and replaced the old ...
3
votes
4answers
54 views

Is it possible to instantiate a Ruby class without calling initialize?

Some times when I write unit tests I need to instantiate a class without the initialize method being invoked. For instance when the constructor instantiates other classes that I will replace with ...
0
votes
0answers
17 views

Python test discovery with doctests, coverage and parallelism

... and a pony! No, seriously. I am looking for a way to organize tests that "just works". Most things do work, but not all pieces fit together. So here is what I want: Having tests automatically ...
0
votes
0answers
4 views

Is there an OpenSource tool to convert a from Clover to Cobertura xml format?

I'm looking for a tool to convert from Clover to Cobertura xml format. Is there a good OpenSource tool to do this?
0
votes
1answer
25 views

python test result reporting

My question is regarding python unittest reporting. I am using the xmlrunner package which produces the xunit output which is used by Jenkins. In addition to that, I want to either produce an html ...
0
votes
1answer
10 views

unittest.mock: asserting partial match for method argument

Rubyist writing Python here. I've got some code that looks kinda like this: result = database.Query('complicated sql with an id: %s' % id) database.Query is mocked out, and I want to test that the ...
0
votes
2answers
20 views

Unit testing subclasses which refer to each other

In Java I have the abstract class Place, with two concrete subclasses Area and Level; a Level must have a parent Area. But in trying to make unit tests for Level, I don't want to have create a ...
0
votes
2answers
30 views

OCMock. Why does the second of these test pass?

I am getting up to speed of mock-ing with iOS using OCMock. I wrote a simple mock-ing unit test that passes when - based on the expectation I set - it should fail. Here is the code: // Scientific ...
2
votes
1answer
21 views

Portable Class Library Testing

So when testing a Portable Class Library without any platform specific code, is testing against just one of the platforms (.net 4.5) from the profile enough? My intuition says no, but I've read some ...
0
votes
1answer
24 views

How do I run unit tests in VS based on different values of a static variable?

I am trying to write a unit test to make sure the results of a method are correct based on different values of a static variable. Here is a simple example: public void TestMethod1() { ...
0
votes
1answer
12 views

Code Contracts not working in Windows Phone 8 unit test

When my unit test runs a method that has Contract.<>, it is failing with an error: An exception occurred while invoking executor 'executor://mswptestadapter/v1': Object reference not set to an ...
1
vote
0answers
27 views

What kind of debugging is this? Semantic Debugging with Visualizations?

So, I'm writing a program to filter some input based on some coefficients that I've calculated. I have test cases in front of me right now (hand tracking data). So now I just need to pick the right ...
0
votes
0answers
11 views

Can I mock an HTML respond in Nodejs testing ? (with nock or another module.)

That's working for me: var scope = nock('http://www.google.com') .get('/') .reply(200, "Hello from Google!"); How can I respond with just an HTML file that I already ...
1
vote
1answer
20 views

Spring Integration Testing methodologies?

I am working on an established application that has no Unit testing. I want to start writing test cases for this application. Bean Mocking is non-existent and it will take me considerable time to set ...

1 2 3 4 5 619
15 30 50 per page