I need to understand and clarify some T-SQL stored procedures that contain important business logic. Does anyone know of any tools, tips, tricks, or hints that can be used for unit testing so I can refactor this sql without breaking it?
...
I am new to unit testing and mocking. I am trying to unit test an abstract domain class in Grails. How should I mock an implementation so I can unit test the constraints of the domain class? Is there a way to use the mock libraries that come with groovy or grails? Should I just implement a class that simply extends the abstract class?
...
I'm developing a Domain Model based on the Repository Pattern and all of my Unit Tests as part of TDD are going against a Test Repository.
My question is: at what point do I create integration tests against the SQL version of the Repository?
My concern is that the code to access data from objects (Test Repository) will work fine. ...
Hello,
I'm using C++Test from Parasoft for unit testing C++ code.
I came across the following problem. I have a function similar to the next one (pseudocode):
bool LoadFileToMem(const std::string& rStrFileName)
{
if( openfile(rStrFileName) == successfull )
{
if( get_file_size() == successfull )
{
i...
I'm creating a program which will be examining images which are uploaded by the users logged in. I have the RMagick code written up to do the examination (basically finding out if a pixel black is in an image), but I don't know how to write the unit tests for this model.
Currently I'm using paperclip to attach the uploaded file to the ...
I'm using jmock to mock out an OutputStream and set expectations on the data that gets written to it.
So I have an expectation that looks something like this
oneOf(stream).write(byteArrayMatching("Some string"));
(byteArrayMatching) is a factory for a custom matcher.
This all works fine, except when the test fails because the class ...
Unit testing Abstract classes in Groovy
I asked a question previous about unit testing and mocking a domain class, but I do not think I was specific enough. I have a domain class:
package toplevel.domain
abstract class Party {
static hasMany = [roles:PartyRole]
static constraints = {
roles(nullable:true)
dateCr...
I write applications for various platforms, but chiefly OS X and Windows. On both, I've been influenced by recent trends in test-driven development (TDD), SOLID, and so on. Most of this I've found to be great advice. I've found that if I have excellent test coverage, I'm more likely to refactor as needed, because I'm more confident that ...
Hello
I am about to start a new personal project. It aims to be a pretty big one so I thought it would be a good idea to keep some sort of CVS. I have also read lot of interesting stuff about unit testing and I would like to include some system that automatically builds the project and runs a series of test after each check in.
The cha...
I'd really appreciate some advice around testing for errors using OCMock.
Method Under Test
It grabs a process using an instance of the AppScriptController class.
@implementation ProcessGrabber
-(void)grabProcess {
NSError *error = nil;
NSString *processName = [appScriptController processName:ProcessRef
...
Can I run nUnit tests in Visual Studio (for instance)?
...
I'm starting out unit testing and reviewing Java web programming. The thing is I don't know if I'm doing things right.
I'm building a mini blog. I'm using EasyMock for the mock objects.
Here's my code:
The test case
The PostDAO
The Post Bean
I'd really appreciate your comments and suggestions on how I could improve my code and bec...
.NET application being tested uses <authentication mode="Forms"> so whenever an instance of WatiN.Core.IE is created the login page appears.
Can successfully fill in the login form and authenticate, but wondering how to handle this for multiple tests? As soon as the IE instance is released, the next test must log in again.
Does WatiN h...
Hello,
I have some concerns related to the fact of testing some functions containing the assert macro from assert.h.
If the assert fails the test fails also.
This leaves me with some test cases that will never work.
For example a function instead of indicating failure (return false or something similar) asserts.
Is there a solution f...
Can you share the way you setup your unit test projects within your .net solutions?
I can imagine several possible methodologies. For example:
Having a separate solution for unit tests, perfectly mirroring the structure of the original code solution being tested.
Inside the original code solution, have a solution folder in which you'r...
BACKGROUND
I am automating an PowerPoint 2007 via C#
I am writing unittests using the built-in unit testing of Visual Studio (Microsoft.VisualStudio.TestTools.UnitTesting) for my code
I am well relatively experienced in automating the Office 2007 apps
MY PROBLEM
When I run my unit tests, the first unit test method runs fine, all af...
How do people set up their projects for Visual Studio and how do you reference the testable application ?
Right now I've added a separate project creating a .dll to my solution which contains all the test cases and references nunit.framework , and it also references the main .exe file right from the Debug/ folder where VS generates the ...
When I attempt to "Run Tests in current context" it runs every test in the entire solution.
This used to work fine but now seems to have either a bug or a configuration problem.
Thanks.
...
Hi
I´m dynamically creating an instance of a class with reflection and this works fine, except when trying to do this through unit testing - I´m using the MS testing framework.
I get the familiar error of: "Could not load file or assembly 'Assy' or one of its dependencies. The system cannot find the file specified"
I have copied the d...
I'm trying to write a C# unit test with VS 2008's built-in unit testing framework and the method I'm testing calls Environment.Exit(0). When I call this method in my unit test, my unit test is Aborted. The method should indeed be calling Exit, and I want a way to test that it does, and also to test the exit code that it uses. How migh...