unit-testing

Separate seeds in PHPUnit

How do I create a separate seed for some test inside one test class? PHPUnit documentation includes this example <?php require_once 'PHPUnit/Extensions/Database/TestCase.php'; class DatabaseTest extends PHPUnit_Extensions_Database_TestCase { protected function getConnection() { $pdo = new PDO('mysql:host=localhost;dbna...

Coded UI Test - How to change the exe it runs

I created a Coded UI Test from a Microsoft Test Manager recording. The exe it runs is the one the tester recorded against. I want this to be a test I run with my build. How do I change the exe that the coded UI test uses to be the output of: The TFS Build when a TFS Build is being run The local build when the test is being run on my...

is it a good idea to write tests for environments other than development?

Let's say I have a (fairly typical) set of environments: PROD, UAT, QA, DEV. Is it a good idea to run your tests across all environments? Here's what I'm thinking of. I have a proc in SQL that my code depends on, I'll call it proc_getActiveCustomers. If that proc isn't present my app will go south real fast. So I write a test that chec...

How do I prevent qFatal() from aborting the application?

My Qt application uses Q_ASSERT_X, which calls qFatal(), which (by default) aborts the application. That's great for the application, but I'd like to suppress that behavior when unit testing the application. (I'm using the Google Test Framework.) I have by unit tests in a separate project, statically linking to the class I'm testing. The...

Testing with Qt's QTestLib module

Hi I started writing some tests with Qt's unit testing system. How do you usually organize the tests? It is one test class per one module class, or do you test the whole module with a single test class? Qt docs (or some podcast that I recently watched) suggested to follow the former strategy. I want to write tests for a module. The mod...

Google App Engine Python Unit Tests

Hi, I'd like to write some Python unit tests for my Google App Engine. How can I set that up? Does someone happen to have some sample code which shows how to write a simple test? ...

Advanced All In One .NET Framework (should i go for a software factory ?)

Hi, i m starting a new project that would basically take input from user and save them to database among about 30 screens, and i would like to find a framework that will allow the maximum number of these features out of the box : .net c#. windows form. unit testing continuous integration logging screens with lists, combo ...

Moq.Mock<T> - how to setup a method that takes an expression

I am Mocking my repository interface and am not sure how to setup a method that takes an expression and returns an object? I am using Moq and NUnit Interface: public interface IReadOnlyRepository : IDisposable { IQueryable<T> All<T>() where T : class; T Single<T>(Expression<Func<T, bool>> expression) where T : class; } Test w...

How do you unit test a class that's meant to talk to data?

I have a few repository classes that are meant to talk to different kinds of data, deriving from an IRepository interface laid out like so: In implementations, the code talks to a data source, be this a directory of XML files or a database or even just a cache. Is it possible to reliably unit test any of these implementations? I don't...

Is there an in memory database that supports the DATE function?

Hi, I am doing some unit testing for a DAO that works with postgresql. Some of the SQL queries that my DAO uses involve the DATE function. Is there an in-memory database that supports functions similar to the ones that postgresql does? Currently I am looking for support for the DATE function however, I obviously can see myself using o...

Unit Testing VS 2008 Using Excel

When using Excel (2003) to provide data for my unit tests it seems to think that when a cell has TRUE / FALSE value that it is null when there has been no preceding cell values e.g. if (TestContext.DataRow["SatisfactionExtremelySatisfied"] != DBNull.Value) model.SatisfactionExtremelySatisfied = (bool)TestContext.DataRow ["S...

spring ldap test - custom schema?

Is there a way i can load a custom ldap schema when using org.springframework.ldap.test.TestContextSourceFactoryBean? E.g. for unit tests? ...

Unit Testing and motivation to do so

I'm currently Unit Testing an application that isn't build to support unit testing very well, lot's of dependencies, refactoring and the developers who build the application didn't think of unit testing when they started developing. My job is to do research for unit testing, unit test the application and bring unit testing into the organ...

Looking for WebAii Framework free edition online - before the Telerik merge

Art of Test produced a nice UI testing tool for free -- WebAii Framework-- that I've been using to add client-side DOM unit tests to my projects. Recently they merged with Telerik and it's now a commercial product. From free to >$1500 is suddenly very expensive. Does anybody know if the community edition is still available, or if the las...

Test run errors with MSTest in VS2010

When I run my Unit Tests, all tests pass, but instead of "Test run succeeded" or whatever the success message is, I get "Test run error" in the little bar that tells me how many of my tests pass, even though all my tests passed. When i click the text, I'm taken to a page that tells me the following two things happened: Warning: conf...

Unit testing in Web2py

I'm following the instructions from this post but cannot get my methods recognized globally. The error message: ERROR: test_suggest_performer (__builtin__.TestSearch) ---------------------------------------------------------------------- Traceback (most recent call last): File "applications/myapp/tests/test_search.py", line 24, in t...

Unit Testing-- fundamental goal?

Me and my co-workers had a bit of a disagreement last night about unit testing in our PHP/MySQL application. Half of us argued that when unit testing a function within a class, you should mock everything outside of that class and its parents. The other half of us argued that you SHOULDN'T mock anything that is a direct dependancy of the ...

Visual Studio 2010 and TFS 2008: Building unit test projects

Hi, We are currently taking VS2010 for a testdrive and so far we are a little stumped with how it just won't cooperate with our existing Team Foundation Server 2008. We still have all our projects on .NET 3.5 and whenever we are now building a solution that contains a unit test project (which automatically builds in .NET 4.0) the TFS wo...

What's the best practice to setup testing for ASP.Net MVC? What to use/process/etc?

hi there, i'm trying to learn how to properly setup testing for an ASP.Net MVC. and from what i've been reading here and there thus far, the definition of legacy code kind of piques my interests, where it mentions that legacy codes are any codes without unit tests. so i did my project in a hurry not having the time to properly setup un...

Continuous Integration For .Net and Javascript with Unit tests

Hi All, I need a Continuous integration tool that will support both .Net Unit tests and Javascript unit tests and perform the builds. It looks like my main options are CruiseControl.NET using JUnit and NUnit or Team City and JS Test Driver. Are there any other options and which ones have you used or had good or bad experiences with. ...