I'm working on a project at the moment that we're using junit to test, but as its still fairly early stages a lot of features aren't yet implemented, though they already have tests written for them
this means these tests (obviously) always fail
I was wondering if anyone knew a way to get JUnit to pass the test while displaying a warnin...
We're using JUnit 4 to test: we have classes that don't are a subclass of TestCase, and they have public methods annotated with @Test. We have one file with many @Test methods. It would be nice to be able to run a subset of them via Ant from the command line, in the style of this recipe for JUnit 3:
ant runtest -Dtest=MyTest -Dtests=tes...
I want to disable the Microsoft.VisualStudio.TestTools.TestTypes.Unit.TestFailedException when I am debugging my unit tests. The problem is when I open the Exceptions dialog in Visual Studio I can't find this Exception. Does anyone know how to stop this exception from being thrown?
...
I'm using Moq for unit testing. It order for Moq to work, properties and methodes have to be marked as virtual. Sometimes I pass in data and set property values in the constructors. Isn't there a rule that you should not set virtual properties in constrcutors since it might cause unexpected behaviour (if the class has been inherited from...
When unit testing, it is always hard to know how low down to the framework you go.
If we have a class that directly depends on the .NET Framework, i.e. the System.IO.File class, then we cant really test that in isolation.
Sure we could wrap it and inject it into the dependent class, but then we start to wrap every .NET class! What...
Is there a way to unit-test classes wich require database connections? e.g. User-Classes
(DB-)Object mocking didn't quite help
...
Right now I have both type of tests but when I say "mvn test" it only executes TestNG tests and not Junit. I want to execute both one after another. Any Idea ?
...
I'm trying to learn how to do Unit Testing and Mocking. I understand some of the principles of TDD and basic testing. However, I'm looking at refactoring the below code that was written without tests and am trying to understand how it needs to change in order to make it testable.
public class AgentRepository
{
public Agent Select(in...
hello good fellas!
i use spring and hibernate for my data access layer
i'll like to have some guidance about how to construct my unit testing to test if hibernate is effectively insert in the child table(parent hibernate mapping has the cascade all on the set).
For what i know i shouldn't mix dao's unit testing.So supposing the i'm testi...
In NUnit, I'm used to writing Trace statements in the test, and having them show up in the trace tab of the NUnit gui.
On a new project, I'm moving to the built in Unit Testing in Visual Studio Professional Addition, which I believe is an interface to mstest.exe.
Test Code:
<TestMethod()>
Public Sub TestPagesInheritFromBasePage()
...
According to this blog post, the ActiveRecord Test features in Subsonic 3 don't support linq. If this is true, it would seem to really constrain the usefulness of the Test features. Is there a workaround, or am I just misreading what was said?
...
I have a very old project implemented in (classic) ASP and SQL Server 2000. Because of quality concerns, I've been considering the possibility of implementing some form of automated quality testing. Though, the web pages are ASP the project is really 85% SQL Server stored procedure, functions, views and DTS. (Lots of dependency on DTS) ...
I'd like to try out Jeremy Mcanally's context gem for testing:
http://github.com/jeremymcanally/context/tree/master
It does not work out of the box with Rails 2.3.x, anyone got it working?
EDIT
hi mike, tx for ur help. i installed the gem like u said, and have added "require 'context'" to test_helper.rb however, it stil doesn't seem t...
I have a Function called dbo.GetFoo(). I also have a unit-testing Stored Procedure called AssertEqual (which takes @TargetValue sql_variant, @ExpectedValue sql_variant, and @Message varchar)
I want to call GetFoo() and check to see if it's returning the right value 'X'. My T-SQL statement is:
exec AssertEqual dbo.GetObjectType(), 'S', ...
I have two tables, Clients and Administrators, which are linked in a many-to-many relationship by the table ClientAdministrators.
In the real application this works fine and I can get a list of Administrators for my Client. My problem comes in trying to unit test the service class that is retrieving this from the repository.
I have a ...
Should I do
Test1(){
Assert(TestCase1);
Assert(TestCase1);
Assert(TestCase3);
...
}
or
Test1(){
Assert(TestCase1);
}
Test2(){
Assert(TestCase2);
}
Test3(){
Assert(TestCase3);
}
...
Note: All test cases are intimately related. There is only boolean differences between them.
...
Which unit testing framework do you use for Symfony?
Lime or PHPUnit? What are the pros and cons of using them?
...
I'm unit-testing some PHP code with SimpleTest and I've run into trouble. In my tests of a database class I want to be able to set an expectation for PHPs mysql functions. In my tests of a wrapper class for the mail function I want to mock PHPs mail function. These are just some examples.
The point is: I don't (always) want to test if m...
I've done a little bit of reading on unit testing and TDD, and I've never seriously considered writing tests to such a precise extent. Granted, I am not working on any projects that are ridiculously huge. If all I build are small apps, am I stupid for not writing tests?
Edit: To clarify, when I say "small apps", I mean apps that are ...
Hello, I'm using VS2008 to develop a project that I'm starting to test under Mono.
There are a number of unit tests written using the VS unit test framework, is there a tool that will let me run these in Mono?
Thanks,
...