tdd

A good UI Unit Testing solution suitable for ASP.NET development (browser UI compatible)?

Hi, does anyone know of a good automated UI Unit Testing solution suitable for ASP.NET development (Browser UI compatible)? Would be interested in learning it if so. NUnit integration / compatibility would be a bonus. ...

How do you design complex systems with TDD?

Similar to http://stackoverflow.com/questions/2149369/does-tdd-mean-not-thinking-about-class-design, I am having trouble thinking about where the traditional 'design' stage fits into TDD. According to the Bowling Game Kata (the 'conversation' version, whose link escapes me at the moment) TDD appears to ignore design decisions made early...

How do I go about unit testing view models in the MVVM-Light framework?

My specific question is when the viewmodel constructor is modeled after the MVVM-Light examples, like this one public MainViewModel() { if (IsInDesignMode) { BackgroundBrush = new SolidColorBrush(Colors.Orange); } else { Messenger.Default.Register<Brush>( this, true, ...

Is it valid to have unit tests with only an assert statement?

So, i'm new to unit testing, and even more so to test first development. Is it valid for me to have just a single assert.isTrue statement in my unit test where I pass in my method and a valid parameter, and compare it to the known good answer? Method public static string RemoveDash(string myNumber) { string cleanNumber = m...

Testing ProcessStartInfo processes execution

Let's assume I have some method that executes CLI application. For example: public string SomeMethod(string cmd) { var p = new ProcessStartInfo(cmd); // processing execution results return result; } How can I change this method to make it testable? I see that I can split that method into 2: 1. Executes CLI app and passes ...

Test Driven Development in Flash

I've recently been working on some bigger projects in Flash and would really like to be able to use Test Driven Development but haven't found a great way to do so. I'd imagine its a bit harder to do in flash as most of its projects require heavy user interactivity (drag and drop with mouse, keyboard input to move etc...). Does anybody k...

Selenium vs Celerity?

Isn't Selenium better than Celerity when it comes to testing web sites cause real browsers like Firefox, Safari, Chrome and Internet Explorer could be used so that we know our website is compatible with each of them. So if I use Celerity (it's java browser), even if all tests pass, doesn't that mean my website could still be incompatibl...

What are some c# projects to look at for good implementation of unit tests?

Not something too large, yet no 2+2=4 type of examples either. Specifically it would be nice if it were WPF and MVVM. I'm confused on what to test for the view model. How do you test what is in Lambda's? Do you? Do you make a function public just so you can test it. Or do you just test the final result? ...

Convenient method in GoogleTest for a double comparison of not equal?

I'm looking for something similar to the ASSERT_EQ / ASSERT_NE for ASSERT_DOUBLE_EQ. Maybe I'm missing an easy way of doing this without having a ASSERT_DOUBLE_NE? ...

RhinoMock : Mocks Vs StrictMocks Vs DynamicMocks

I understand the difference between a Mock and a Stub. But different types of Mocks in RhinoMock framework confuses me. Could someone explain the concepts of Mocks Vs StrictMocks Vs DynamicMocks in terms of RhinoMock framework. your answers are greatly appreciated. ...

Can/should directories for test frameworks be consolidated into a top-level directory (a la vendor/plugins)?

For some reason, I find it really irksome that the files for each testing framework (rspec, test::unit, cucumber, etc.) live in a separate folder in the top level of my app. Is there a strong reason these directories should be scattered about instead of consolidated like gems/plugins in the vendor directory? If there isn't an actual ...

When doing TDD, why should I do "just enough" to get a test passing?

Looking at posts like this and others, it seems that the correct way to do TDD is to write a test for a feature, get just that feature to pass, and then add another test and refactor as necessary until it passes, then repeat. My question is: why is this approach used? I completely understand the write tests first idea, because it helps ...

How to develop a StopWatch class test first?

I'm currently trying to implement a StopWatch class. The interface is something like: interface IStopWatch { void Run(); void Stop(); int SecondsElapsed { get; } int MinutesElapsed { get; } } Basically my app will need to use a StopWatch, but for testing purposes it'd be nice to have a way of artifially modifing a Stop...

Using NUnit to test that an IEnumerable was sorted correctly (uses nested sort)

I'm using MVP with ASP.NET Web Forms. Being a good TDDer, I want to test all the important behaviors in my Presenter, including the default sort it applies to the result set retrieved from the service layer. The Presenter will be applying a nested sort via LINQ to Objects of the style: public IEnumerable<ViewModel> MyModel{ get ...

Application Testing with Rails

Hi, This is more of a general question and some sort of best practice discussion. How would one test a Rails application? There are mantras like BDD and TDD and frameworks like RSpec and Cucumber but how much is enough and what is the best way to go? Is it enough to use Cucumber as integration tests? Are you guys writing additional ...

Is there any "advanced" testing framework for .NET?

I am looking for a testing framework that allows me to have: Different kinds(categories) of tests. I want to be able to just run all "fast" tests or all "slow" tests. I know MSTest allows you to create lists and run then run them, but I find it annoying and distracting. I'd like to just tag the tests with attributes as I am developing ...

Confused about testing an interface implementing method in C++.. how can I test this?

Please, consider the following (I'm sorry for the amount of code; but this is the minimal example I could think of...): class SomeDataThingy { }; struct IFileSystemProvider { virtual ~IFileSystemProvider() {} //OS pure virtual methods } struct DirectFileSystemProvider { //Simply redirects the pure virtuals from IFileSystem...

How to test "Too Many Files Open" problem.

I have a batch process that converts WAV to MP3 sequentially. The problem is that after a few thousand there are too many files left open, and it runs up against the file limit. The reason it does this is because of the code in SystemCommandTasklet: FutureTask<Integer> systemCommandTask = new FutureTask<Integer>(new Callable<Integer>()...

Rails autotest with ubuntu and remote growl

I am using ubuntu to develop my rails apps in a virtual machine and I want to send growl notifications in my windows which is in a LAN (growl exists in windows also). I wrote a simple script to send notifications from ubuntu to windows remotely and it worked perfectly (with the ruby-growl gem), but I was wondering if autotest/growl sup...

What can't be solved by TDD?

I was just perusing the TDD tag and noticed that the 1,000th TDD question was due to be asked. I figured it should be a big one - and I guess that means community wiki. TDD solves many things for us - guarantees testable code, promotes low coupling and high cohesion, enhances readability and generates its own "executable documentatio...