Questions for unit-testing


6093

Compare equality between two objects in NUnit

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

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:
2374

Implement Repository Pattern in Asp.Net MVC with SOA architecture

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

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.
8784

Objective C - Unit testing core functionality in private methods?

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

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?
9505

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.
9903

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) ?
9977

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.
8766

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.
6780

information on TAP and TDD for 'C'

I am precisely looking for the info like ,
7490

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.
6842

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.
3296

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:
3354

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...
5061

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.
6590

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?
7284

JMockit NullPointerException on mocked object in Expectations

Here is the relevant part of my test case:
9816

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...
7993

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
3903

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
7177

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...
1732

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.
8530

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...
7026

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:
9121

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...
6090

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 ...
1706

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?
2048

Seeking simple visual unit test summary for Eclipse

I have to shift development from NetBeans to Eclipse.
2726

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.
6058

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
6567

Specifying *stack-trace-depth* in Clojure tests

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

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:
9020

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.
8882

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
7725

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:
9530

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.
3750

Mockito - verify a double value

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

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 =...
888

Unable to read configuration file in a test project

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

Unit testing destructors?

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

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'...
4649

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...
3197

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
1908

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.
9868

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:
1808

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.
5956

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.
805

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).
5971

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.
4517

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.