unit-testing

Are multiple asserts bad in a unit test? Even if chaining?

Is there anything wrong with checking so many things in this unit test?: ActualModel = ActualResult.AssertViewRendered() // check 1 .ForView("Index") // check 2 .WithViewData<List<Page>>(); // check 3 CollectionAssert.AreEqual(Expected, ActualModel); // check 4 ...

unit testing framework for Microsoft Visual C++ 6.0

Is there a unit testing framework for Microsoft Visual C++ 6.0? ...

Why do I get a Illegal Access Error when running my Android tests?

I get the following stack trace when running my Android tests on the Emulator: java.lang.NoClassDefFoundError: client.HttpHelper at client.Helper.<init>(Helper.java:14) at test.Tests.setUp(Tests.java:15) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:164) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.ja...

Where should I store a sample xml file used by a grails unit test?

I've written an xml parser, and I've written a unit test to go with it. Where should I store the actual xml file to be used by the test? Should I just store it under test/unit/whatever package the test is in? ...

GoogleTest: Accessing the Environment from a Test

Hey! I'm trying out gtest for C++ (Google's unit testing framework), and I've created a ::testing::Environment subclass to initialize and keep track of some things that I need for most of my tests (and don't want to setup more than once). My question is: How do I actually access the contents of the Environment object? I guess I could th...

junit4 test runner

hello how could we uses junit related methods? could we launch setup once from each java test? if in my test I launch the apply by calling setup once, is it correct ? ...

Will IOC solve our problems?

Just trying to implement unit testing into a brownfield type system. Be aware i'm relatively new into the unit testing world. Its going to be a gradual migration of course because there are just so many areas of pain. The current problem i'm trying to solve is we followed a lot of bad practices from our VB6 days and in the conversion...

DDSteps date question.

DDStep Date Question: Currently trying to pass just the date from excel. But getting the below error while doing it. Failed to convert property value of type [java.lang.String] to required type [java.util.Date] for property ...no matching editors or conversion strategy found spring for date conversion I even tried to add customEditorCo...

DDSteps Collection/Association Question

How do we represent associations, collections in the excel spreadsheet while using DDSTEPS? Let us take an example. Department has many employees. In the spreadsheet how do we enter data for employee for a specific department? I tried something similar below in the excel but is not working. Any help is appreciated. department.name, ...

Looking for Info on a Javascript Testing framework

Hi Can somebody fill me in on JavaScript Testing Frameworks? I'm working on a project now and as the JS (Mostly jQuery) libraries grow, it's getting more and more difficult to introduce change or refactor, because I have no way of guaranteeing the accuracy of the code without manually testing everything. I don't really know anything a...

C# Unit testing resources

I migrated from Java to C# and so I am wondering how to unit tests in C#. I remember using JUnit to test my Java applications. How can I unit test in C#? What are some good resources for unit testing in C# USING THE DEFAULT UNIT TESTING LIBRARY? I don't really need a port. A good resource would be like a nice PDF file, article, or better...

Unit testing a controller in ASP.NET MVC 2 with RedirectToAction

I have a controller that implements a simple Add operation on an entity and redirects to the Details page: [HttpPost] public ActionResult Add(Thing thing) { // ... do validation, db stuff ... return this.RedirectToAction<c => c.Details(thing.Id)); } This works great (using the RedirectToAction from the MvcContrib assembly). ...

MSTEST CollectionAssert use with generics?

It appears that CollectionAssert cannot be used with generics. This is super frustrating; the code I want to test does use generics. What am I to do? Write boilerplate to convert between the two? Manually check collection equivalence? This fails: ICollection<IDictionary<string, string>> expected = // ... IEnumerable<ID...

What is unit testing?

Possible Duplicate: What is unit testing? What is unit testing and unit testing libraries like xUnit? I understand it's testing specific code, so what's the difference between this and just opening a new project and test this specific code? ...

jUnit same exception in different cases

Hi, I'm writing a jUnit test for a constructor that parses a String and then check numerous things. When there's wrong data, for every thing, some IllegalArgumentException with different message is thrown. So I would like to write tests for it, but how can i recognize what error was thrown? This is how can I do it: @Test(expected=Illega...

Best unit testing framework for Clojure?

What is the best unit testing framework for Clojure? I prefer a more BDD style framework. Thanks, Alex ...

Question about CppUnit

Does CppUnit have the ability to generate an html or xml file of its test cases and test results? ...

Difficulty thinking of properties for FsCheck

I've managed to get xUnit working on my little sample assembly. Now I want to see if I can grok FsCheck too. My problem is that I'm stumped when it comes to defining test properties for my functions. Maybe I've just not got a good sample set of functions, but what would be good test properties for these functions, for example? //transf...

question about learning TDD

what are the best books to learn about junit, jmock and testing generally? Currently I'm reading pragmatic unit testing in Java, I'm on chapter 6 its good but it gets complicated.. is there a book for a bottom up? from your experience which helped you get the testing concept ...

Google Toolbox For Mac with Core Data on iPhone results in error

I have set up my project for using Google Toolbox for Mac as described on official wiki. And everything is working as expected. For core data usage I have created a 'database' class that uses for final application SQLite storage (this is done based on Xcode template code). For unit tests I have created separate init method for 'databas...