views:

55

answers:

1

Hi, I was wondering if there was anything that provides test data for injecting into Nunit tests?

I'm sure I came across something recently that does this but I couldn't find it again. Basically the idea is that I could use selenium and Nunit to create new customers within the system automatically.

So I could have selenium type in customer names generated from test generator (the < DataGenerator > is just an imaginary class): e.g.

dim sFirstName as string = < DataGenerator >.GetRandomFirstName()
dim sLastName as string = < DataGenerator >.GetRandomLastName()
selenium.type("firstname_field",sFirstName)
selenium.type("lastname_field",sLastName )

I've already seen SQLDataGenerator from Redgate which has a cmd line wrapper class, but I was wondering if there was anything else.

A: 

Have you looked at PEX?

It looks for input and output parameters and can work with many unit testing frameworks including NUnit.

Depending on how your methods are organized, this could work to generate test data for your methods.

Take a look at the video here to see a demo.

Paddyslacker
Thanks I'll have a look. I was also looking at xeger which is a regular expression data generator. Basically it provides a random string given a RegEx, but it is only available in Java and hasn't been ported to .NET unfortunately (as far as I know).
Jon