unit-testing

Unit Test ASP.NET application

I need a tool or framework that will allow me to perform unit testing on ASP.Net applications.....Do you have one ...

How can I measure the overhead of a mocking framework (TypeMock)?

I'm just beginning to evaluate mocking frameworks for my team and am wondering if anyone has any pointers to reference documentation or experience that you can share regarding the cost of mocking when doing performance tests. Links? Personal experience? Details appreciated. ...

testing dao with hibernate genericdao pattern with spring.Headache

Hello good fellas! in my journey of learning hibernate i came across an article on hibernate site. i' learning spring too and wanted to do certain things to discover the flexibility of spring by letting you implement you own session.yes i don't want to use the hibernateTemplate(for experiment). and i'm now having a problem and even the t...

How do you unit test Jboss Rules (Drools) rules?

I have written a few Drools rules for my Seam application and am wondering how I go about unit testing these. Does anybody have any sample code that can show me how to go about doing this? ...

Testing Java database entity classes

Currently we are testing out entity classes and "worker" classes by writing java servlets for each entity and doing Insert,update,delete,find... for each entity to ensure that it works. The worker classes are simply implementations of an interface that persists the entity to the database using JDBC, they do the DB work for the entity. W...

How do I properly setup a RunLoop in Order to Unit Test NSURLConnection?

I'm using the unit testing tools provided in the Google Toolbox for Mac and I want to unit test some code involving NSURLConnections. I believe I need to setup my own NSRunLoop if I want to be able to do this. What is the proper way to setup such a run loop? ...

Possible ways for testing automation of ASP.NET2.0/ADO.NET project

What approaches could you please suggest me for testing (using NUnit?) a complex ASP.NET 2.0 solution - large web-site with a number of depending assemblies (App_Code is inside on of them). I want to test web pages functionality - will web controls like GridView, FormView, DetailsView, etc insert and load the data from SQL Server 2008 p...

Using old code to verify results in unit tests

Lets says I'm replacing an over complicated method with a much simpler implementation that I believe does the same thing. Would it make sense for me to copy the old code into a class with my unit tests so I can assert the result of both is the same? Thanks ...

RuntimeType instead of Type in C# Unit Test

Hi, In one of my unit tests I want to check if all public methods are returning type of ActionResult. Here's my test method: [TestMethod] public void Public_Methods_Should_Only_Return_ActionResults() { MethodInfo[] methodInfos = typeof(MyController).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFl...

CoverStory for iPhone testing?

I'm trying unsuccessfully to get CoverStory working in an iPhone project. Unfortunately XCode build settings and gcc flags are a big mystery to me. :( I've managed to generate .gcno files but the .gcda files don't show. I've added -lgcov as an other linker flag, set both the GCC_GENERATE_TEST_COVERAGE_FILES and GCC_INSTRUMENT_PROGRAM_FLO...

Point me to some open source projects *with* (unit) tests.

For reference, I'm looking for some open source projects with unit tests. Edit - Surely there must be more! ...

OSS PHP projects using PHPUnit for unit-testing ?

Hi, I know there are two main unit-testing frameworks in PHP : PHPUnit SimpleTest I am using PHPUnit, and was searching for PHP (Open source would be great ; but I'm also interested in non-OSS ones, if they are big / well-know / from big companies) projects, be it applications, libraries, frameworks, ... that would use PHPUnit as U...

Test case to fail this code?

I have to maintain code from a contractor. It has this "interesting" snippet: String webServicesValue = webResponse.substring(webResponse.indexOf("<" + fieldName + ">") + fieldName.length() + 2, webResponse.indexOf("</" + fieldName + ">")); It took me a few minutes to understand wh...

How to access classes in another assembly for unit-testing purposes?

I'm jumping into unit-testing the Visual-Studio 2008 way, and I'm wondering what's the best way to accomplish cross-assembly class access for testing purposes. Basically, I have two projects in one solution: MyProject (C#) MyProjectTests (C# Test Project) Everything in MyProject currently has default accessibility, which if I recall...

Should I write rails tests with the def or test keyword?

This seems like a simple question but I can't find the answer anywhere. I've noticed that in general, tests in a Ruby on Rails app can be written as: test "the truth" do assert true end or def the_truth assert true end It seems newer material writes tests the first way, but I can't seem to find a reason for this. ...

How can I fake STDIN in Perl?

I am unit testing a component that requires user input. How do I tell Test::More to use some input that I predefined so that I don't need to enter it manually? This is what I have now: use strict; use warnings; use Test::More; use TestClass; *STDIN = "1\n"; foreach my $file (@files) { #this constructor asks for user input...

Moq: unit testing a method relying on HttpContext

Consider a method in a .NET assembly: public static string GetSecurityContextUserName() { //extract the username from request string sUser = HttpContext.Current.User.Identity.Name; //everything after the domain sUser = sUser.Substring(sUser.IndexOf("\\") + 1).ToLower(); return sUser; } I'd l...

Unit testing with lots of use cases

I am working on a java application which has a lot of use cases. Inputs to the application are different kinds of events occuring at different times. This kind of input gives rise to hundreds of test cases. Has anybody faced this kind of scenario? Do you make sure all the test cases are covered before making a release to the QA team? So ...

Unit test that aspx pages get routed correctly?

I have a hybrid ASP.NET MVC application, and I'd like to test that the route table properly allows my .aspx pages to be loaded. In particular I'm interested in making sure that the root of my site goes to index.aspx, not to a controller. Update: You can test for the Ignored paths in the routing table. However, this doesn't test for the ...

Ruby unit testing: how to fake Time.now?

What's the best way to set Time.now for the purpose of testing time-sensitive methods in a Unit test? Thanks! ...