unit

Recommended Unit Testing Book for an ASP.NET MVC environment

I need recommendations on a good Unit Testing book for use with ASP.NET MVC. Based on books you have actually read and use (your bible), what do you recommend? ...

why do .net Database unit tests using TransactionScope and MSDTC fail ?

We have some unit tests running against a SQL server 2000 database using the DatabaseTestFixture (http://softwaredevscott.spaces.live.com/blog/cns!1A9E939F7373F3B7!155.entry ) class which uses a TransactionScope that is not commited and therefore all changes are rolled back. The tests ran against a local database with no problem. ...

Unit testing asp.net mvc - Can viewengine find the view?

Hi I am finding that a common breakage point in our mvc setup is when the controller returns return View(); or whatever, and the viewengine cannot find the view. I would like to be able to test my controllers and then run ExecuteResult on the resulting ViewResult but the underlying ViewEngine is so tied to virtual directories that...

Mocking Spring MVC BindingResult when using annotations

I'm migrating a Spring MVC controller to use the newer style annotations, and want to unit test a controller method that validates a command object (see simple example below). @RequestMapping(method = RequestMethod.POST) public String doThing(Command command, BindingResult result, HttpServletRequest request, HttpSer...

How to Unit Test POCO's? Or shouldn't they be tested?

Hey there, I want that my unit tests to cover my POCO's. How should I test them? What If I add a new property? How to make my test fail? Testing the properties and methods I know, but the problem is, how to make sure my tests fail is anything is added to my poco's. Cordially, ...

VSTS 2005 Load Test Console - Total Test Cases Run do not get updated

Hi, I have been using VSTS 2005 for creating Unit Test cases and also to run Load Tests. VSTS Test Edition has a feature where I can use Unit Test created inside Load Test, i.e, I can stimulate multiple users for a created Unit Test to check performance. If I run a load test (which internally is calling a unit test, not a web test) for...

How to recompile a specific unit from the VCL?

I want to apply a fix from QC to a Delphi 2009 unit (DBClient as it happens). I know I need to copy the unit to another directory and make the change to the copy. How do I then get Delphi to compile that unit and use it in favour of the DCU that already exists? ...

How can I use a data file in a VS 2008 unit test?

I have the files checked in to svn. The key is that I don't want to hardcode the paths to the files. How can I use relative paths and be able to find the data files consistantly? ...

Unit Testing Database Driven .NET Applications

What is the best way to unit test heavily database dependant .NET middleware? E.g. a process which reads data from multiple databases, manipulates it, and then combines and writes it to other databases? Should the databases be filled with static data which is somehow reset on each unit test run? Should the whole SQL Server access be som...

Grails domain unit testing - mockFor()

Hi, This is the domain class: class Registration { String email String generatedKey def beforeInsert = { String newToken = GlobalHelper.getRandomString() generatedKey = newToken } } and this is the relevant part of the unit test: def c = mockFor(GlobalHelper) c.demand.static.getRandomString {-> return "...

There is any tool for UI Unit Testing iPhone application(Not SenTestCase)

Hi EveryOne, I am looking for any tool or approach using which I can do UI unit test for iPhone application, I am aware of SenTestCase framework however which is used to do that testing for code I am looking for UI unit testing. Any suggestion will be great help to me. Thanks in advance. Regards, Satish. ...

Creating mock Objects in PHP unit

Hi, I've searched but can't quite find what I'm looking for and the manual isn't much help in this respect. I'm fairly new to unit testing, so not sure if I'm on the right track at all. Anyway, onto the question. I have a class: <?php class testClass { public function doSomething($array_of_stuff) { return Anothe...

Audio Unit and Writing to file

I'm creating real-time audio sequencer app on OS X. Real-time synth part is implemented by using AURenderCallback. Now I'm making function to write rendered result to Wave File (44100Hz 16bit Stereo). Format for render-callback function is 44100Hz 32bit float Stereo interleaved. I'm using ExtAudioFileWrite to write to file. But ExtAudio...

problem with em unit

Hi, I want to use relative size instead of fixed size. I want to use em. My CSS is: body{ font:10px; } #wrap { font:1.2em; } #wrap ul li { padding-left:2em; } What is value of the li's padding in px? I would have guessed it's 2.0*10 = 20px, but it looks like it's taking 1em = 12px, I mean it taking it parent size. I wo...

Rails batch object creation for fixture?

I have a big list of record (something like 20, could be more) with a has_many :through relations, which is a bit complicate and it looks ugly on yml. Factory_girl doesn't seems to give me the simplistic ability to just create the fixture with a AR based script (it's a lot shorter that way) any good recommendation on what I could do? ...

What is a unit of work in regards to database objects?

In layman's terms, what is a unit of work in regards to database objects? I'm researching how to convert database tables into C# classes and I frequently come across this term, but everyone seems to describe it as if you should already know what it is. ...

BUilding Flex project with unit testing on cruise control

Hi, I have a flex application build with actionscript 3 on flex builder with unit testing on it using flexUnit4. I want to build this project on my cruise control and i don't know how? ...

How can i CloseComm, OpenComm, WriteComm and ReadComm with the windows unit?

I have an old comm unit that uses WinTypes,WinProcs. As i understand these were merged too the Windows unit. Are there similar functions in the Windows unit? ...

Unittesting Corba in Python.

Hi there, I am interested in your opinions on unittesting code that uses Corba to communicate with a server. Would you mock the Corba objects? In Python that's sort of a pain in the ass because all the methods of Corba objects are loaded dynamically. So you're basically stuck with "mock anything". Thanks! Note: I believe I have not m...

Creating DOM structure using jQuery for unit testing

Hi all: Suppose I have the following html: var testString = ' <span id='id'> <div> <table> <span id='anotherId' class='NODE customContext' name='2'></span> </table> </div> </span>' and I want to convert it to a DOM structure using jQuery (under the assumption that jQuery is the best option to handl...