unit-testing

What tools can I use for Django Testing Automation?

I'm looking into automating a test runner which would do the following things daily (or hourly or whenever I want basically): Pull the latest code from a git repository. Run the Django test suite or something like Nose. Run Selenium tests. Give Pass/Fail and coverage statistics via a web interface. Email developers in the case of failu...

@ExpectedException in grails unit tests

Anyone used this annotation in grails unit tests? Didnt seem to work for me. Thanks. D Update: the last line of my test below does throw the expected exception. However the test fails (Stack trace too big for here...). I'm using grails 1.2 and running the test in eclipse's junit runner. Maybe grails is using an earlier version of junit...

Where to place common library for unit test functions in Cakephp?

Currently several of my unit tests need common functions such as logging in a specific user from the mock objects or making sure that no one is logged in. I currently have those functions in a file which I include via a regular old include statement. That doesn't seem very cakey to me. I also don't want to keep typing the include statem...

How do I manually specify the test files to run in autotest?

How do I manually specify which test/unit test files should be run when a non-test file gets updated? ...

"pause" being ignored

I read that I must be able to run all unit tests in my site with a single command, so I created a bat file to do it. Even with pause before the end, after the phpunit command, the result of the unit tests flashes in the screen. @echo off cd c:\ cd xampp cd htdocs cd light cd myworks echo on set /p site=The site: set /p version=The vers...

Using SimpleHTTPServer for unit testing

Hello, I'm writing a Python module that wraps out a certain web service API. It's all REST, so relatively straightforward to implement. However, I found a problem when it comes to unit testing: as I don't run the services I made this module for, I don't want to hammer them, but at the same time, I need to retrieve data to run my tests...

Mock testing with Repository pattern example.

I'm refactoring existing class to support Products import from CSV file.   Requirements: 1) during import products are identified by special product number. 2) product has category attribute. If such category exist - use its id, if not - create it first. 3) if product with some number already exists in DB - do an update of other fie...

testing TLV protocols

Hi all, I need to test STUN protocol. Is there any framework to test this protocol? Any other test protocol framework that tests TLV based protocol would also be helpful. Thanks in advance. update: Adding some more details. STUN - rfc5389 (along with ICE - draft-ietf-mmusic-ice-19 )is an IETF protocol for NAT traversal. STUN & ICE pr...

How to use ipython's IPShellEmbed from within a running doctest

Please help me get an embedded ipython console to run inside a doctest. The example code demonstrates the problem and will hang your terminal. On bash shell I type ctrl-Z and then kill %1 to break out and kill, since ctrl-C won't work. def some_function(): """ >>> some_function() 'someoutput' """ # now try to drop ...

Can CakePHP's testAction method survive a redirect call?

I'm starting to write unit tests using the CakePHP framework and SimpleTest. The documentation describes a problem with the testAction method when your controller redirects the browser to another page. There is a hopeful note with a link to a possible fix, but the link is broken. Has anybody gotten this working? Know how to find where t...

How to eliminate stack trace when running Specs through SBT?

I have a Scala project that I'm using SBT and Specs on. When I run sbt test, it correctly runs my tests, but a failing test results in a huge stack trace. [info] == caravan.DependenciesSpec == [info] specifies [info] x Status should mirror single job org.specs.specification.FailureExceptionWithResult: 'caravan.Status(2)' is not eq...

F# development and unit testing?

I just got started with F#, which is my first functional language. I have been working quasi-exclusively with C#, and enjoy a lot how F# leads me to re-think how I write code. One aspect I find a bit disorienting is the change in the process of writing code. I have been using TDD for years in C# now, and really appreciate to have unit te...

How can I create NUnit tests with ReSharper?

Hi, I'm trying to get into unit testing with C#. Various people told me to go with NUnit since it's better than MSTest (apparently, I have no idea) and it also has very good support in ReSharper which I'm using. Now I've never written a unit test before in my life (bear with me, I'm a university student). ReSharper has this nice Create...

Unit testing custom model binder in ASP.NET MVC 2

I've wrote custom model binder in project, that uses ASP.NET MVC 2. This model binder bind just 2 fields of model: public class TaskFormBinder : DefaultModelBinder { protected override void BindProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor) ...

How to use Visual Studio test for a method which returns datatable

I'm new to visual studio tests, I created a new test method to test a method which returns a datatable based on the tablename passed, but I'm confused as to how to test such a method, since the results are variable based on what's in the backend store at any point in time [TestMethod()] public void GetTableDataTest() { ...

Mocking framework from Microsoft?

I want to start using mock objects on my c# project. After a quick google I've found that most folks use one of the below: NMock EasyMock.Net TypeMock Isolator Rhino Mocks Moq Does Microsoft provide a similar framework for mocking? I'm using Visual Studio tests for my unit test now. ...

How to mark a whole class as "Inconclusive"?

Hi, I've a test class named MyClass. MyClass has a TestFixtureSetUp that loads some initial data. I want to mark whole class as Inconclusive when loading initial data fails. Just like when somebody marks a test method Inconclusive by calling Assert.Inconclusive(). Is there any solution? ...

WSDL parser validation & benchmarking tests?

Please recommend WSDL parser validation & benchmarking tests. I need for both 1.1 and 2.0 . Thank you in advance! ...

Javascript header equivalent in JsTestDriver/Javascript testing

Hi all: I want to insert a function before the DOM or jQuery's document.ready loads in my JsTestDriver test file. I tried inserting it in the setUp function, but upon alerting the length of document.ready list in the first line of code, the document.ready has already been loaded. I have tried inserting tags to it, but JsTestDriver doe...

How to write a Mock Repository to test WCF RIA Domain Service build on top of Entity Framework Context.

Hi, I need to write a test layer to Test my WCF RIA Domain Service layer which is build on top of Entity Framework context. I have come across some patterns which suggest to use a repository and then use the Domain Service factory to intilize the domain service with a repository instance to use. One of the sample which fits the requirem...