I've read a lot about the available .NET unit testing frameworks. What is not clear to me is what are the key features that differentiate the available frameworks. What are the must-have features that you look for when evaluating unit testing frameworks?
...
I've created a few small fluent interfaces through method chaining. They typically call a number of Repositories that fetch data from webservices / databases.
How should I go about unit testing methods that use the fluent interface?
Public IEnumberable<Computer> FindComputers(string serialNumber)
{
return Computers.FindBySerialNu...
I have some unit tests (yes, perhaps more integration-ey tests !) that I would like to spin up another jvm, and then run the test code from that "other" JVM (and wait for it to finish, collecting the results).
Am interested if there is an easy/reliable way of doing that with junit (eg inherit the classpath of what is needed etc...)
Any...
Hi
I have a static class which calls a static Logger class,
e.g
static class DoesStuffStatic
{
public static void DoStuff()
{
try
{
//something
}
catch(Exception e)
{
//do stuff;
Logger.Log(e);
}
}
}
static class Logger
{
public static void Log(Exception e)
{
//do stuff here
...
My unit tests are in a separate directory tree from my integration tests, but with the same package structure. My integration tests need external resources (e.g. a server) to be available, but my unit tests are properly independent of each other and the environment.
In IntelliJ-IDEA (v7) I have defined a JUnit Run/Debug Configuration to...
I am using gallio to integrate mbunit's test runner with the mstest test runner in visual studio. it works VERY well - except when I am running a test with multiple assert statements. The test will either pass or fail based on the FIRST assert statement. I know a lot of people are against multiple asserts, but they are unavoidable in cas...
I'm following this tutorial I'm focusing on the testing portion.
I'm trying to test the following snippet:
def test_disallowed_passwords
u = User.new
...{some more testing code}
assert !u.save <<<<<<This is line 27
The
u. save
should fail in this case.
When I run the test, I get the following:
...
I'm building a new application and trying to adhere to "test-first" development as faithfully as I can. I'm finding myself in situations where I need to implement/change a feature that has an effect of invalidating a number of existing unit tests. How should I be dealing with this? As I see it, there are 3 options:
Update or remove all...
Hi,
Can you help with the problem which i'm currently facing?
We've created ASP.NET MVC application with "Out Proc" seesion state managment. We are using strong type session in our control class.
Here sample code FYR..
Public Class CustomerController
Inherits TxnProcess
TxnProcess -- this class extended by another class which is...
Hi,
I need to insert dummy data on test environtment so that I can run unit test on it but I don't know how to declare it on BootStrap (just for testing, not for all environtment)
can you help me ? thank you in advance
...
When I try to generate a unit test for the following method (in a public static class)
private static string[] GetFields(string line, char sep)
{
char[] totrim = { '"', ' ' };
return line.Split(sep).Select(col => col.Trim(totrim)).ToArray();
}
The Tests output says:
While trying to generate your tests, the following errors oc...
I know that unit testing is desirable, and I am interested in doing unit testing. The only problem is I have no idea how, or even where to start really. So my question is: How do I learn about and start unit testing? Specifically I frequently write Java code in NetBeans and C# code in Visual Studio and am interested in what tools to u...
Hello,
I think understand the definition of State / Interaction based testing (read the Fowler thing, etc). I found that I started state based but have been doing more interaction based and I'm getting a bit confused on how to test certain things.
I have a controller in MVC and an action calls a service to deny a package:
public Acti...
If someone has created a small diagnostic, internal web app that uses (unit) tests as its logic, is there ever a valid reason to do that? Keep in mind that Nunit has to be deployed as well where ever this website goes.
I'm of the view that programs should contain their own logic and possibly reusable parts (if available) but not wrap t...
I'm testing how some of my code handles bad data, and I need a few series of bytes that are invalid utf8. Can you post some, and ideally, an explanation of why they are bad/where you got them?
Thanks!
...
I have a class that I want to test the DialogResult value for. To get that type I need to add a reference to System.Windows.Forms.
Is it bad practice to have this included in a test project?
...
I am about to start a new project and am looking around for both a unit testing framework and some sort of code coverage profiler. I've used the unit test framework in Visual Studio Pro in the past but I've never used a coverage framework.
Does anyone have views on the best unit testing and code coverage frameworks around at the moment?...
I'm testing an extension method on an interface 'ISomeInterface'. The extension method actually calls to another method in the interface.
How do I set up a mock and the appropriate expectations (i want to set the expectation that 'SomeMethod', which is an defined method in the interface with a different signature then this extension met...
Just curious. Tried to google this, but found nothing. I remember earlier there was some information related to this, but now I can't find anything at all.
So... I'd appreciate any help ;)
...
I have a strange problem,
my MSBuild runs tests, code-coverage and publishing fine (part of the build.txt shown):
Results Top Level Tests
------- ---------------
Passed BuildTestProject.UnitTest1.TestMethod1
Passed BuildTestProject.UnitTest1.TestMethod2
2/2 test(s...