Questions for unit-testing


Compare equality between two objects in NUnit

I'm trying to assert that one object is "equal" to another object.

Sharing Rspec tests between classes

Hey all; in writing tests from controller to controller with rspec, I've found myself duplicating a few basic tests, such as this check for index:

Implement Repository Pattern in Asp.Net MVC with SOA architecture

We have starting new project in our company. We finalize the architecture as follows

Which opensource java or .net project has best unit test coverage?

I want to dive more into the unit testing concepts. An open source project which will illustrate the best practices in unit testing is required.

Objective C - Unit testing core functionality in private methods?

I've been in many situations where my core logic is in private methods.

MSTest robustness

We have a number of issues with MSTest failing randomly on a list of 300+ .NET unit test. Is MSTest robust enough for serious unit testing or we need to look for a 3rd party tool?

Unit Testing - dependant tests

I am creating a list of unit tests that are dependant on each other. For example, my first test creates a record in the database and checks that the return value is greater than 0.

Unit-testing method invocation (template method)?

Is it possible to unit-test method invocation on the same class(in order and how many times they were invoked) ?

Starting ASP.NET Development Web Server (Cassini) as part of unit test setup?

I'm using WatiN, NUnit and ReSharper to run my ASP.NET unit tests inside Visual Studio. I'd like (if it's not already running) to start Cassini to run my tests against.

Mocking a Repository returning a list

I'm beyond lost in the woods at this point, I keep making the same changes over and over with the thought that intellisense is just hiding something from me.

information on TAP and TDD for 'C'

I am precisely looking for the info like ,

How do I activate JButton ActionListener inside code (unit testing purposes)?

I need to activate a JButton ActionListener within a JDialog so I can do some unit testing using JUnit.

moq: How do I setup behaviour of constructor in generated proxy?

I have an abstract class (let's call it AbstractOutputter). When I derive from it, I make calls to a protected method in the constructor of the derived class.

Unit testing fake repository, how can I test the GetById method without first adding an entity?

My understanding is that you have to write unit tests that isolate functionality. So given a repository class that has this method:

How can I auto run py.test once a relative command has been change?

Via autonose or nosy, it will automatically run the nosetests once the some tests file or the relative files have been changes. I would like to ask that whether py.test provides the similar functio...

Testing Events from Objects

I have been trying to get more in to TDD. Currently keeping it simple with lots of Debug.Asserts in a console application.

Silverlight Unit Test Framework Rerun Tests

Ok, maybe this is a really dumb question and I'm just not seeing the button...but how do I rerun checked tests in the SL Unit Testing application UI?

JMockit NullPointerException on mocked object in Expectations

Here is the relevant part of my test case:

Implementing Repository pattern and doing Tests

I have read almost all articles about Repository pattern and different implementations of it. Many of them judged bad practices (ex: using IQueryable<T> instead of IList<T>) etc. that w...

MVC Advantages of Unit Testing Controllers

My application already has unit test for domain layer I would like to know what are the pros/cons of unit testing controller

What is the best Nunit test runner out there?

Having recently gotten into test driven development I am using the Nunit test runner shipped as part of resharper. It has some downsides in terms of there is no shortcut to run tests and I have to go

is supplying a default constructor considered a best practice for testing?

I'm working with the Moles Framework for mocking. I'm running into some roadblocks with objects that don't have argument-less constructors. When I create the object in question, I have to provide a...

Testing NHibernate with SQLite “No Such Table” - schema is generated

I'm trying to use an in-memory SQLite database to test my data layer which is provided by NHibernate.

Can unit tests have a execution time criteria?

Is it good practice to have a unit test that specifies how long a certain function takes to return a value. I'm unit testing a curl function and want to specify that it needs to time out after 5 se...

Organising iOS OCUnit test files in XCode

I am adding unit tests to an existing iOS project using OCUnit with Xcode 4.2. I have successfully added a new build target (following instructions here:

Mocking vs. Test DB?

Earlier I asked this question How to correctly unit test my DAL?, one thing left unanswered for me is if to really test my DAL is to have a Test DB, then what is the role of mocking vs. a testing D...

Inducing sane multiple assertions with integration tests

I have came across many resources which talk about using/not using multiple assertions during unit testing. But while writing UI level automation integration tests I end up in doing many assertion ...

How to check the value is in object with Chai?

Is it possible to test the value is contained within certain array with Chai assertion library?

Seeking simple visual unit test summary for Eclipse

I have to shift development from NetBeans to Eclipse.

How can I get Inner Exception text from Test Results run on TFS 2010

I have some MSTest unit tests that are running just fine on my machine but are failing in my autobuild.

How do I test database-related code with NUnit?

I want to write unit tests with NUnit that hit the database. I'd like to have the database in a consistent state for each test. I thought transactions would allow me to "undo" each test so I searched

Specifying *stack-trace-depth* in Clojure tests

What is the correct way to set the value of *stack-trace-depth* in Clojure tests?

Is there a C# unit test framework that supports arbitrary expressions rather than a limited set of adhoc methods?

Basically NUnit, xUnit, MbUnit, MsTest and the like have methods similar to the following:

How to decide test cases for unit tests?

I'm just getting into unit testing, and have written some short tests to check if function called isPrime() works correctly.

gmaven-plugin SAX parser error

Today, I've encountered a strange problem with Groovy code that is run from Maven (using gmaven-plugin). I'm using Groovy only in Unit tests. All unit tests pass in Eclipse, however, I get errors on

PHPUnit - Running a particular test suite via the command line test runner

Is it possible to specify which test suite to run from a configuration file via the command line test runner? For example, if I have the following xml configuration:

OCMock expect a method called within another method

This is an extremely basic question about OCMock expectations. Let's you have an instance method methodA on objectA that calls an instance method methodB on objectA.

Mockito - verify a double value

I have a method called method1 that takes a double which is called on myManager

Class not eligible for getting processed by all BeanPostProcessors

I'm having a lot of trouble to set up a configuration of Spring + Spring Data JPA + QueryDSL + JPA 2.0 + Hibernate in Maven. I already solved a lot of problems, but this one is giving me headache =...

Unable to read configuration file in a test project

When running a unit test, the configuration file is not read properly.

Unit testing destructors?

Is there any good way to unit test destructors? Like say I have a class like this (contrived) example:

How can I create a ramdisk in Python?

I want to create a ramdisk in Python. I want to be able to do this in a cross-platform way, so it'll work on Windows XP-to-7, Mac, and Linux. I want to be able to read/write to the ramdisk like it'...

Is it possible to get VS 2010 to build before running tests

I have a Class Library project in Visual Studio 2010 that I want to test. I have created a seperate Test project in the same solution to test it. The Test project references the Class Library proje...

PHP DRY Throwing InvalidArgumentException

In a framework I am building, I am moving towards making my code more testable as I was previously addicted to the MVC+Singleton pattern and had static classes galore. Since then, I have started to

Symfony2 with LiipFunctionalTestBundle error when i load fixture

i've installed LiipFunctionalTestBundle and try to use it since yesterday but i've got an error and i don't know how to solve it.

Testing controller methods protected from forgery in Rails

I'm trying to test a method I have in my application, but I don't know how to unit test a method that is being protected from forgery, take a look at this:

How to do unit testing without the use of a library?

I've never written a single unit test. But since every article I read, they are talking about unit testing. I figured I should get started with it.

Unit testing method that uses UI controls

I'm currently writing some methods that do some basic operations on form controls eg Textbox, Groupbox, these operations are generic and can be used in any application.

RhinoMocks Event Subscription

Being new to RhinoMocks and Unit Testing, I have come accross an issue that I cannot seem to find a resolution to (no matter how much documentation I read).

Isolating dependencies in Silverlight unit tests

I'm in the process of writing an LOB application in Silverlight and I'm a little dismayed by all the roadblocks I'm hitting with unit testing.

Unit tests and functional tests in CodeIgniter

Is there any testing framework for CodeIgniter?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.