tdd

Is it Possible to have Dynamic - On-The-Fly DeploymentItems?

I want to write tests to check the existance (and other stuff) of certain files that will be shipped with our project. This is what I have right now: [DeploymentItem("1.pdf")] [DeploymentItem("2.pdf")] public class DoFilesExist { List<string> _Files; public DoFilesExist() { _Files = new List<string>(); ...

TDD for IMDB html scraper

I'm currently developing a TDD idmb html scraper which ill extract certain fields from the imdb webpage. Eg. Title, Synopsis,Cast etc in C++. I'm just wondering if i have done the TDD right , i have 2 classes the Parser Class & MatchPattern class. The parser class has like a loadfile function that loads the file into a string and then...

How can I load a local resource synchronously in Flex 3?

I want to store some test data for a FlexUnit test in small XML files in my Flex project, and access them trivially for the flex test. How can I load these bits of data synchronously? HTTPService is the way I'd be loading them _a_synchronously, but adding event handlers to my test cases seems like a bit of overkill. ...

How do I tell MSTEST to run all test projects in a Solution?

I need to know how to tell MSTEST to run all test projects in a solution file. This needs to be done from the command line. Right now I have to pass it a specific project file, I'm trying to get it to run from a SOLUTION file. I'm hoping this is possible, because in Visual Studio, hitting Ctrl+R, A, runs ALL tests in the currently ope...

TDD, DDD and Encapsulation

Hi all, After several years of following the bad practice handed down from 'architects' at my place of work and thinking that there must be a better way, I've recently been reading up around TDD and DDD and I think the principles and practices would be a great fit for the complexity of the software we write. However, many of the TDD sa...

New to TDD: Are there sample applications with tests to show how to do TDD?

I really want to get into TDD development but I have no point of reference where to start. I think that looking at code and seeing how they write tests and make classes testable that it'll be easier for me to digest and start using myself. Is anyone aware of any sample or small open source C# applications that include unit tests? ...

Eclipse: bind some key for all unit tests

Hi! I'm practice TDD and run my tests very often. Eclipse has nice command to run last launched configuration. But when I in some unit test, Eclipse run only test for current unit test. I want run all my unit tests instead. Yes, i can use mouse to run command that run all junit test, but, repeat. I'm run tests very often. ...

Is there a set of stubs/mocks for JDBC available anywhere?

For the past few years I've continuously struggled with unit testing database code and all the pain that comes with it. I found this existing thread which I found very enlightening: What's the best strategy for unit testing databases? The author of the accepted answer suggests that it might be useful to mock the entire database layer...

Free Testing / Code Coverage systems for C++

I'd like to start using a Test Driven Development system for a private project since I saw my employer using it and realized it was very useful. My employer's project was in C# but mines are in C and C++. I looked around and saw that several packages exist for both Java and .NET (for example: NCover, NUnit, ...). Unfortunately I found i...

Test Controllers or The BusinessModel?

After reading the first 7 chapters of Pro ASP.NET MVC Framework -a very recommended read, i'd say. Throughout my reading, the author -Steve Sanderson, touched on some TDD practices a lot. Now my question is: Steve used to perform his unit tests against the controllers themselves, an example of the book: [Test] public void List_Inc...

Unit Testing: Logging and Dependency Injection

So regards logging from SO and other sites on the Internet the best response seems to be: void DoSomething() { Logger.Log("Doing something!"); // Code... } Now generally you'd avoid static methods but in the case of logging (a special case) this is the easiest and cleaniest route. Within the static class you can easily inject ...

TDD - One test at a time or make a batch?

For unit tests should you; Write a test. Write code to pass it. Refactor. Or Write all your known tests. Make one pass. Refactor. I ask this because TDD states you stop writing code after all tests pass but this point is unclear. Edit One thing I think TDD focuses on more for this "rule" is in relation to stories/task...

How do I incorporate TDD into my workflow as a scientific programmer / student / researcher?

I'm busy! Most of my time is spent using analytical techniques, or on course work, and when I switch over to programming mode I need to generate code quickly. Since, the Primary Investigator for the lab I'm in doesn't care if I'm using TDD or an abacus as long as I get results fast. I've read "TDD by example" and found it quite helpful....

Unit Testing Flex Event Handlers

What methods do you use to unit test event handlers, particularly if they require information from the event (such as mouse coordinates, or the target of the event)? Is the most common practice to just refactor the behavior into a method that does the lifting while the handler just extracts information from the event, or are there effect...

Good resource to learn BDD, TDD (ruby , C#, javascript)

What are the good resource to learn BDD & TDD (ruby , C#, javascript). What are the good framework using now? ...

Fastest editor/ide for for TDD workflow: test > code > test?

I've found that test first development can be painful if the workflow is slow. It can take a long time to write a test, compile, run the tests, write code, compile, then run the tests again. Part of the problem is that the delays to compile and run tests to some extent interrupts my flow. When my brain has an idea, I want to be able t...

In Visual Studio, is there a way to generate unique method names automatically?

I'm writing a bunch of tests for a class, and frankly I don't want to go to the effort of naming each test intelligently: "Compare2002to2002forLessThanOrEqual" I'm cool with TestMethod1 through TestMethod120 - but I've got to edit each name, and that gets annoying. Is there any plugin that will generate unique names for all the methods...

Getting Started with TDD?

We are in the initial phase of trying to implement TDD. I demo'd the Visual Studio Team System code coverage / TDD tools and the team is excited at the possibilities. Currently we use Devpartner for code coverage, but we want to eliminate it because its expensive. We have very limited experience in TDD and want to make sure we don't go a...

Is it a code smell for one method to depend on another?

I am refactoring a class so that the code is testable (using NUnit and RhinoMocks as testing and isolations frameworks) and have found that I have found myself with a method is dependent on another (i.e. it depends on something which is created by that other method). Something like the following: public class Impersonator { private ...

NUnit Categories in combination?

In my NUnit testfixtrues i have something along the lines of [Test,Category("catA")] public void test1 { // } [Test,Category("catB")] public void test2 { // } [Test,Category("catA")] [Test,Category("catB")] public void test3 { // } Now in the NUnit gui i want to be able to select catA and catB and run the tests where cat...