I'm trying to understand the Activity Testing tutorial on the Android site. One of the tests sets a spinner in the SpinnerActivity example, forces a pause, then resets the spinner, forces a resume, and then verifies that the application properly restored the state. I pasted the relevant code at the bottom of this question for reference...
I just created an action filter that I want to apply to nearly all of my controllers (including any new ones that are introduced later on).
I figure a really useful unit test would be one that cycles through each controller and verifies that if certain criteria are met, then the action filter will impact the result.
Is it wise to creat...
Hey all,
I have a function, which I'd like to get under test. However, it's very large and creates a finite state machine. The function looks roughly like:
std::auto_ptr<IFiniteStateMachine> CreateFSM()
{
std::auto_ptr<IFiniteStateMachine> = apFSM( new CFiniteStateMachine() );
std::list<IState*> listStates;
listState.pus...
Throwing ActiveRecord::Rollback works, but not in tests.
I've had this problem before, am now having it again, and for some reason can't find any record of someone else having this problem.
I'm this is because tests do a rollback each time a test runs, and most databases don't support nested rolllbacks. However, I can't be the only pe...
What steps should you use when in a need to write unit tests for STI associations. I am completely confused. Please provide some suggestions or links to some tutorials.
Thanks in advance
...
I am having a lot of headaches maintaining a website right now. Most often things would end up breaking after a couple of updates. This website was started by two developers in our team and then passed on to me. I was wondering if it would be alright to go with unit testing and acceptance testing considering that I'm halfway through the ...
I'm trying to define a return value for a Mock (model).
Can anyone explain to me why the following code fails with a "Invalid setup on a non-overridable member":
model.SetupGet(x => x.PostCodeSearch).Returns(It.IsAny<string>);
and yet I can do this and it works fine:
model.Object.PostCodeSearch = "Any value as long as it's not null ...
In one of our service classes I have a bunch of methods which just return the DAO result with no processing like
public void acceptRequest(User from, User to) {
rosterDAO.acceptRequest(from, to);
}
The unit test for this method looks like this
private final RosterDAO rosterDAO = context.mock(RosterDAO.class);
...
public void tes...
Say I have the following business logic:
foreach (var item in repository.GetAll())
{
if (SomeConditition)
{
item.Status = Status.Completed;
repository.Update(item);
}
}
Now I write the following unit test:
public void Test()
{
var repository = new FakeReposit...
I want to write testcases for my android application using JUnit.
And I faced some problems.
Is it possible to check that activity displays some dialog at current moment?
Here is a small piece of my test application:
...
Instrumentation instr = getInstrumentation();
monitor = instr.addMonitor(MainActivity.class.getName(), n...
After years of faithful nUnit use, I'm having a fling with the Visual Studio Unit Testing framework thats built into VS2008.
Apart from the crushing guilt ; ) ... one of the issues is that 'VSTest' creates a file and a folder every time you run tests, and those files ('Visual Studio Test Results File') and folders really build up over t...
The situation: I used generate scaffold to set up my objects in a new Rails project. Besides doing some migrations, I also directly edited the MySQL tables by adding and renaming columns etc. Now I can't get tests to run because the automatically-generated fixtures do not correspond to the database schema. Perhaps they're based on the or...
I'm using NHibernate to persist this entity:
public class Store
{
public int Id { get; protected set; }
public int Name { get; set; }
}
Note how the Id property has a protected setter. This is to prevent users from changing the Id while still allowing NHibernate to assign it an Id when it saves it to the database.
In one of m...
Let's say I have the following class:
class Foo
{
public:
Foo()
{
Bar();
}
private:
Bar(bool aSendPacket = true)
{
if (aSendPacket)
{
// Send packet...
}
}
};
I am writing a test harness which needs to create a Foo object via the factory pattern (i.e. I am not instan...
Hello,
I have an application where many "unit" tests use a real connection to an Oracle database during their execution.
As you can imagine, these tests take too much time to be executed, as they need to initialize some Spring contexts, and communicate to the Oracle instance. In addition to that, we have to manage complex mechanisms, s...
How do you load test fixtures using the django-nose test runner?
...
I have code like this:
class ToBeTested
{
function simpleMethod($param)
{
if(0 === $param)
{
trigger_error("Param is 0!", E_USER_WARNING);
return false;
}
return true;
}
}
and test for this code:
class SimpleTest extends PHPUnit_Framework_TestCase
{
function testSimpleMethod()
{
$toBeTest...
I am trying to get OCUnit to do anything on my project, but I am failing :-(
Is there any good tutorial out there to get it work? Everything I find tells something different and they are all pretty complicated ...
What I tried is e.g.
set up a Unit Testing Target
add my Target as dependency
add a xxTest.m to my unit target and writ...
Are there any good frameworks for automated testing of AWT GUIs?
Integration with JUnit would be a plus.
...
I'm extending RUnit (a unit testing suite for R) so that it produces also output that can be read by Hudson. actually I already have something that does this, but it does not handle 'deactivated' tests.
to see what I mean, have a look at the r-forge project 'rtest' (it temporarily identifies itself as RUnit, but it further works rather...