Is there any way to pass generic types using a TestCase to a test in NUnit?
This is what I would like to do but the syntax is not correct...
[Test]
[TestCase<IMyInterface, MyConcreteClass>]
public void MyMethod_GenericCall_MakesGenericCall<TInterface, TConcreteClass>()
{
// Arrange
// Act
var response = MyClassUnderTest.My...
I'm trying to test an Activity in android which will show a ProgressDialog and everything works fine in the App, however when I try to use ActivityUnitTestCase and the test causes the Activity to show the dialog it fails with this error:
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli...
Recently I have been trying to use unit tests in my code, and I like the idea in principle. However, the parts of my code that I am most eager to test are those error-prone areas which unit tests alone don't handle very well; for example:
Network code
Filesystem interactions
Database interactions
Communication with hardware (e.g. speci...
I'm just getting into Factory Girl and I am running into a difficulty that I'm sure should be much easier. I just couldn't twist the documentation into a working example.
Assume I have the following models:
class League < ActiveRecord::Base
has_many :teams
end
class Team < ActiveRecord::Base
belongs_to :league
has_many :play...
NUnit supports a feature where you can specify a set of data inputs for a unit test to be run multiple times.
[RowTest]
[Row(1001,1,2,3)]
[Row(1,1001,2,3)]
[Row(1,2,1001,3)]
public void SumTests(int x, int y, int z, int expected)
{
...
}
What's the best way to accomplish this same type of thing using MSTest? I can't find a similar...
In a custom ActionFilter, I want check the attributes on the controller action that will be executed. Running through a small test application, the following works when launching the app in the asp.net development server-
public class CustomActionFilterAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(Action...
When trying to run my unit test under Chess, it get the following error:
Hosting rules specify that the test
type 'Unit Test' cannot run in the
host adapter 'Chess'. To run this test
in 'Chess', change the hosting rules.
To use the default test host for tests
that cannot be run in the specified
host adapter, change the te...
Hi,
I am wondering if it is possible to test Google App Engine Servlets using Cactus or HTTPUnit?
If possible, is there a reference/guide on this?
Thanks!
...
Imagine a model structure as follows:
models/cross_sell_promotion.rb
class CrossSellPromotion < Promotion
has_and_belongs_to_many :afflicted_products, :join_table => :promotion_afflicted_products, :foreign_key => 'promotion_id', :association_foreign_key => 'product_id', :class_name => 'Product'
has_and_belongs_to_...
Hi,
It is often said that interfaces making mocking and unit testing an easier process. How do interfaces help with this?
Thanks
...
how to create generic functions that could be called from each java test?
In my function startappli I have :
public class startappli{
public void testMain (String[] args)
{
String[] logInfos = new String[3];
logInfos[0] = (String) args[0];
logInfos[1] = (String) args[1];
}
@BeforeClass
public static void setupOnce() {...
I'm writing a unit test for a custom subclass of org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<T>
and I need a stub implementation of org.springframework.http.HttpInputMessage. Looking through the Spring unit tests in the SVN repository, I found the class MockHttpInputMessage, which does exactly what I want.
Now...
We are using MVP (Supervising Controller) for ASP.NET WebForms with 3.5 SP1.
What is the preferred way to check the value of a view property that only has the a set operation with RhinoMocks?
Here is what we have so far:
var service = MockRepository.GenerateStub<IFooService>();
// stub some data for the method used in OnLoad in the pr...
I have now witnessed two companies move to agile development with scrum.
In both cases the standard of coding was good enough when each part of the application was only being work on by one or two developers with the developers spending a reasonable amount of time working on one part of the application before moving to the next task. ...
Hi,
I'm using the Windmill test system and have it running using test_windmill for Django which works fine for the Python tests. I'd like this to run a suite of Javascript tests also whilst the Django test server is running. I've used the run_js_tests call from the Windmill shell which works fine but I can't find a way to have this run ...
for example, here's some code from an implementation of an attached behavior for a double click command:
private static void fe_MouseDown(object sender, MouseButtonEventArgs e) {
if (e.ClickCount != 2) return;
...
}
assuming you have a thin client with the bulk of the logic in a testable architecture, is there ...
Hi,
I hope this question is not 'controversial' - I'm just basically asking - has anyone here purchased TypeMock and been happy (or unhappy) with the results?
We are a small dev shop of only 12 developers including the 2 dev managers. We've been using NMock so far but there are limitations. I have done research and started playing with...
I work on codebase that doesn't have any unit tests in place and I'm trying to get add some unit testing to it. The code is VB.NET but isn't very object oriented. We're using NUnit for unit testing. A lot of the classes have shared/static methods.
I'm trying to unit test a method that calls other methods that use the data access layer. ...
I'm trying to set up integration tests using the AbstractTransactionalJUnit4SpringContextTests base class. My goal is really simple: insert some data into the database using the simpleJdbcTemplate, read it back out using a DAO, and roll everything back. JPA->Hibernate is the persistence layer.
For my tests, I've created a version of t...
I'm still figuring out a few of the finer points around unit testing my ASP.Net MVC2 application using NUnit.
On the whole, testing my ActionResults, models, respositories and the like is straight-forward, but I've not had to test Ajax methods before and I'd like some guidance on how I should best go about it.
Thanks in advance.
...