unit-testing

Testing form inputs in PHPUnit

What's the best way to test $_GET and $_POST inputs in PHPUnit? I have a class that sanitises input and want to check that it works correctly when processing bogus data. Is there an easy way to set up the form variables in PHPUnit or should I just pass off the validation to a secondary class/functions that are fed the form variables so...

Are there any emulator for the JTAPI API?

We want test the JTAPI feature of our application. Are there any emulator for JTAPI available? The testing with real hardware is a little diffcult. ...

What is the best reason for unit testing?

There's a lot of discussion about unit testing these days. Here's a poll for the best reason to do it. ONLY ONE REASON PER ANSWER PLEASE! ...

Learning Unit Testing

So I've put this off for a good long time and I think it's time to stop procrastinating. I need to learn how to do unit testing, but I don't know where to start! Does anyone have any good, preferably online, resources on the subject? Exact Duplicate: What is your single favorite book or online resource for getting started with unit te...

Is there something like ZenTest/Autotest for Java and JUnit

I've used ZenTest and autotest to work on Ruby projects before, and I used to using them for test-driven development a la this configuration. I have a project that I'm currently working on in Java, and I was wondering if there is something similar in the Java world to achieve the same effect. ...

What are the dangers of making a method virtual?

I've been doing some mocking with RhinoMocks and it requires that mocked methods be made virtual. This is fine except we have a custom framework which contains the methods that I want to mock which are currently not marked as virtual. I can't forsee any problem with making these methods virtual but I was wondering what are some potentia...

Is there any way in .NET to programmatically listen to HTTP traffic?

I'm using browser automation for testing web sites but I need to verify HTTP requests from the browser (i.e., images, external scripts, XmlHttpRequest objects). Is there a way to programmatically instantiate a proxy for the browser to use in order to see what its sending? I'm already using Fiddler to watch the traffic but I want somethi...

Unit Testing without Assertions

Occasionally I come accross a unit test that doesn't Assert anything. The particular example I came across this morning was testing that a log file got written to when a condition was met. The assumption was that if no error was thrown the test passed. I personally don't have a problem with this, however it seems to be a bit of a "code ...

How do I automate a web proxy in .NET for unit tests (including set up and tear down)?

Following Jonathan Holland's suggestion in his comment for my previous question: Is there any way in .NET to programmatically listen to HTTP traffic? I've made a separate (but not exactly a duplicate) question for what I really want to know: How do I automate a web proxy in .NET for unit tests (including set up and tear down) for spying...

Do you use WaTiR?

Is there a better unit testing tool than WaTiR (tag) for Ruby web testing? Or is the defacto standard? What unit testing tools do you use? ...

In Visual Studio, when would I want to use the Test View?

For managing unit tests in Visual Studio, I use the Test List Editor. There's also a Test View which looks similar but more limited. When would I want to use the Test View as opposed to the Test List Editor or any of the other test windows? ...

How do I test a django database schema?

I want to write tests that can show whether or not the database is in sync with my models.py file. Actually I have already written them, only to find out that django creates a new database each time the tests are run based on the models.py file. Is there any way I can make the models.py test use the existing database schema? The one tha...

Handling TDD interface changes

I've begun to use TDD. As mentioned in an earlier question the biggest difficulty is handling interface changes. How do you reduce the impact on your test cases as requirements change? ...

Regular expression to match common SQL syntax?

I was writing some Unit tests last week for a piece of code that generated some SQL statements. I was trying to figure out a regex to match SELECT,INSERT and UPDATE syntax so I could verify that my methods were generating valid SQL, and after 3-4 hours of searching and messing around with various regex editors I gave up. I managed to g...

Unit Tests for comparing text files in NUnit

I have a class that processes a 2 xml files and produces a text file. I would like to write a bunch of unit / integration tests that can individually pass or fail for this class that do the following: For input A and B, generate the output. Compare the contents of the generated file to the contents expected output When the actual co...

Which object should I mock?

I am writing a repository. Fetching objects is done through a DAO. Creating and updating objects is done through a Request object, which is given to a RequestHandler object (a la Command pattern). I didn't write the DAO, Request, or RequestHandler, so I can't modify them. I'm trying to write a test for this repository. I have mocked out...

What is the best way to start Unit and Functional testing of a Ruby Rails website?

I am testing a Ruby Rails website and wanted to get started with Unit and Functional testing. ...

Auto-generation of .NET unit tests

Is there such a thing as unit test generation? If so... ...does it work well? ...What are the auto generation solutions that are available for .NET? ...are there examples of using a technology like this? ...is this only good for certain types of applications, or could it be used to replace all manually written unit testing? ...

Unit testing in flex

Are there any unit testing solutions for Flex? or actionscript 3? If so, what are their features? Any UI testing abilities? Functional testing? Any pointers, examples, libraries or tools that you can share? ...

Unit/Automated Testing in a workflow system

Do you do automated testing on a complex workflow system like K2? We are building a system with extensive integration between Sharepoint 2007 and K2. I can't even imagine where to start with automated testing as the workflow involves multiple users interacting with Sharepoint, K2 workflows and custom web pages. Has anyone done automate...