Hi,
I'm trying to get Figure 3 Fake Database from IRepository using the example here
http://msdn.microsoft.com/en-us/magazine/dd263069.aspx
public class InMemoryRepository : IRepository
{
private readonly Cache<Type, object> _types;
private MockUnitOfWork _lastUnitOfWork;
public InMemoryRepository()
{
_types = n...
Hello all,
I have some unit tests which need to access some values depending on my own computer. For example, a test needs to access a file path, but this file path may vary on other testers' computers.
What I'm thinking is that I need to put these values into a config file which allows the testers to config on their own computers bef...
Title says it all. It appears to be extremely difficult to design a generic test harness for Pro Series because of the way forms are invoked, etc.
The problem I face is that while I can invoke each form, and the logic for the form is (generally speaking) logically separated in a different class, there is to my knowledge no way at this ...
I learnt that using Customizable Authencation backends philosophy, one can create a website which accepts email addresses as usernames. But after building the corresponding logic and testing that my code is working fine, I found one issue with Django's own testcases. They were failing to follow the Customizable Authencation backend philo...
Is there any easy way to automatically run my unit tests after a successful compilation?
...
I am looking for ways of making the following more concise.
public class MyTests
{
IPresenter presenter;
[SetUp]
public void SetUp()
{
presenter = MockRepository.GenerateStub<IPresenter>();
}
...
}
In particular specifying the type again when creating the mock seems redundant. For example I can write...
If I click on 'debug all tests' in Visual Studio 2008 it takes ages to start (whereas 'run all tests' starts instantly). As far a can tell, this is because it is downloading symbols from Microsoft. Why is this? Is there anyway I can stop it or to make it start faster?
...
Situation:
I have a module Foo::Quux::Bar, living in ./Bar.pm. I need to be able to unit test Bar. However, it is not advantageous due to circumstances beyond my control to set up a Foo/Quux directory structure.
So what I'd like to do is have some sort of unit_test_use routine that lets me grab Bar.pm and move/copy its functions into ...
Hi,
In our unit testing, I've got a stub object that is creating a set of data in memory to be used during unit testing so that the live database is not used.
I have unit tests that check the number of rows returned from this set using the query under test and the values supplied to the query in the test. My first issue is that because...
Hi.
I am not able to get Resharper profile a unit test, although I have dotTrace installed on my machine. Actually, the dotTrace button in VisualStudio is also greyed out.
the VisualStudio AddIns menu list dotTrace as started.
VS2008 sp1
Windows 7 64bit
R# 4.5
dotTrace 3.1
I tried Restarts, Reinstall, Re-whatever.
Has anyone experien...
I want to introduce Unit Testing to some colleagues that have no or few experience with Unit Testing. I'll start with a presentation of about an hour to explain the concept and give lots of examples. I'll follow up with pair programming sessions and code reviews.
What are the key points that should be focussed on at the intrduction?
...
Hi all.
I have installed Google Toolbox for Mac (http://code.google.com/p/google-toolbox-for-mac/) into Xcode and followed the instructions to set up unit testing found here (http://code.google.com/p/google-toolbox-for-mac/wiki/iPhoneUnitTesting).
It all works great, and I can test my synchronous methods on all my objects absolutely fin...
I'm trying to understand how to configure TFS Team Build to provide a CI solution for my project. I have a fairly common setup that I have several categories of unit tests. For simplicity lets say there are two categories:
Exchange2003
Exchange2007
Each test category needs particular software to be installed on the Build Agent so ...
Are there any good unit testing and acceptance testing frameworks that can be applied to XCode projects? I'm accustomed to doing TDD in Ruby and Python but am new to Objective-C and XCode.
...
User model:
class User < ActiveRecord::Base
named_scope :clients,
:conditions => "roles_users.role_id = #{Role.find_by_name('client').id}"
end
When testing, throws error:
Called id for nil, which would mistakenly be 4 -- if you really wanted (etc.)
Role fixtures:
client:
name: client
user:
name: user
Apparent problem:...
I want to test my RESTful applications directly via HTTP and I am looking for tools that can help me with that task. Basically I am looking for an easy wrapper for HTTP requests that can submit e.g. HTML forms or serialized resources as JSON or XML.
It would be great if there is a way to verify if the service is actually following REST ...
I've got an MVC app that I've set the globalization in the web.config. All is well in the web app. But in my tests project I'm getting an issue in my service layer. I'm asking for date of birth in the following format dd/MM/yyyy. I'm passing this as a string to my service layer. I've got a RegEx to check that it is formatted correctly bu...
I'm new to the PHP SimpleTest framework, and I was surprised to see that a failed assertion doesn't halt the test method. In other words, this causes two failure messages in the test report:
function testFoo() {
$this->assertTrue(true, 'first: %s');
$this->assertTrue(false, 'second: %s');
$this->assertTrue(false, 'third: %s'...
I am using Moq and I am sort of new to it.
I need to test a private method.
I have 2 assemblies.
CustomerTest.dll
CustomerBusiness.dll
So
CustomerTest dll has a class as follows:
[TestFixture]
public class CustomerTestFixture
{
var customerMock=new Mock<ICustomer>()
customerMock.Protected().S...
I know Ctrl + F9 runs a single file.
How to run them all?
If there is no such thing, how to bind one keyboard shortcut to it?
...