Re: unit testing gone mad

2011-06-05 Thread Les Hughes
Tristan Reeves wrote: Hi list, I'll describe the situation in as little detail as possible. There's some code in which a class BaseClass, and a class ClassForUse : BaseClass are defined. BaseClass is used in a unit test that calls its constructor with mocks. ClassForUse is used in production

Re: unit testing gone mad

2011-06-05 Thread djones147
Hi, I would test that the interface is not null. And that the functionality of the class (via interface) is correct. As for class inheritance, you should only expose constructors in the base class, and any additional constructors that require additional information. Passing a magic number

Re: unit testing gone mad

2011-06-05 Thread Mark Ryall
There's a lot of opinion and not much science with TDD. I'd be sceptical of someone who introduced themselves as a TDD ninja. It takes an enormous amount of practice to develop expertise (5,000 hours) so almost everyone is a beginner. Read Kent Beck and Uncle Bob on what they think is best to

Re: .NET Consultant role - Microsoft

2011-06-05 Thread ste...@malikoff.com
There are also some typos in those 12 pages. I always have a number of people proof read my CV to fix such things. I'll point them out when I see you at work tomorrow ;) Steve. -Original Message- From: Heinrich Breedt [heinrichbre...@gmail.com] Date: 06/01/2011 03:05 PM To: ozDotNet

RE: Generic class question

2011-06-05 Thread James Chapman-Smith
The technique that I've used in the past for this is to have a dictionary of delegates for each type. Then I define a static variable to hold them - or use DI to inject them. private static DictionaryType, Delegate _parsers = new DictionaryType, Delegate() { { typeof(int), (Funcstring,

Re: unit testing gone mad

2011-06-05 Thread Tristan Reeves
Many thanks to all respondents. There's something there for me to mull over. Regards, Tristan. On Sun, Jun 5, 2011 at 8:03 PM, Mark Ryall mark.ry...@gmail.com wrote: There's a lot of opinion and not much science with TDD. I'd be sceptical of someone who introduced themselves as a TDD ninja.

Re: unit testing gone mad

2011-06-05 Thread Heinrich Breedt
Just wondering, what is the name of the test? On Jun 5, 2011 5:06 PM, Tristan Reeves tree...@gmail.com wrote: Hi list, I'll describe the situation in as little detail as possible. There's some code in which a class BaseClass, and a class ClassForUse : BaseClass are defined. BaseClass is

Re: unit testing gone mad

2011-06-05 Thread mike smith
On Sun, Jun 5, 2011 at 5:06 PM, Tristan Reeves tree...@gmail.com wrote: Hi list, I'll describe the situation in as little detail as possible. There's some code in which a class BaseClass, and a class ClassForUse : BaseClass are defined. BaseClass is used in a unit test that calls its

Re: [OT] Backups

2011-06-05 Thread mike smith
On Fri, Jun 3, 2011 at 5:10 PM, Greg Keogh g...@mira.net wrote: Subversion. That way I get a change history as well. *Danger Will Robinson*! A version control system is not a backup. Greg Why? It's on a server on the other side of the world. The dudes that control it run backups of

Re: [OT] Backups

2011-06-05 Thread mike smith
On Fri, Jun 3, 2011 at 5:20 PM, Greg Keogh g...@mira.net wrote: Bec, don't rely on memory sticks. I bought a 16GB stick at the swap-meet a few weeks ago and one morning when I put it in I was asked for format it. I brushed this off as a coincidence, so I formatted and it work fine to another

Re: [OT] Backups

2011-06-05 Thread mike smith
On Sat, Jun 4, 2011 at 11:06 PM, Greg Keogh g...@mira.net wrote: *Danger Will Robinson*! A version control system is not a backup. That seems like a strange statement. Surely it depends what you're backing up. Strange arguably, but no: who backs up the version control files? Version

Re: [OT] Backups

2011-06-05 Thread mike smith
On Sat, Jun 4, 2011 at 11:19 PM, Greg Keogh g...@mira.net wrote: I try to keep it simple. I use the old XCopy to copy what is important to external hard drives (2 Copies) and keeping it safe. Don’t use xcopy, use robocopy. SERIOUS WARNING: My wife ran a batch file I created for her

Re: unit testing gone mad

2011-06-05 Thread Tristan Reeves
ClassForUseInheritsBaseClass On Mon, Jun 6, 2011 at 6:22 AM, Heinrich Breedt heinrichbre...@gmail.comwrote: Just wondering, what is the name of the test? On Jun 5, 2011 5:06 PM, Tristan Reeves tree...@gmail.com wrote: Hi list, I'll describe the situation in as little detail as possible.

Re: unit testing gone mad

2011-06-05 Thread Heinrich Breedt
As an exercise, try making the method name articulate what you are testing. Use underscore for space. Don't be afraid to use longish sentence On Jun 6, 2011 12:32 PM, Tristan Reeves tree...@gmail.com wrote: ClassForUseInheritsBaseClass On Mon, Jun 6, 2011 at 6:22 AM, Heinrich Breedt

RE: [OT] Backups

2011-06-05 Thread Greg Keogh
If there's a hole in my argument I need to know. Well, it seems clear to me that a version control system is written specifically for that purpose, and a backup system for that specific purpose (unless the designers and authors of the system have made some political statement about

Re: unit testing gone mad

2011-06-05 Thread Mark Hurd
I wouldn't be writing these tests just for themselves, but they do check if someone attempts to change the base class without knowing what is going on. Similarly for the member tests. If these were perhaps created automatically, that would be OK, just. -- Regards, Mark Hurd, B.Sc.(Ma.)(Hons.)

Re: [OT] Backups

2011-06-05 Thread mike smith
On Mon, Jun 6, 2011 at 1:05 PM, Greg Keogh g...@mira.net wrote: If there's a hole in my argument I need to know. Well, it seems clear to me that a version control system is written specifically for that purpose, and a backup system for that specific purpose (unless the designers and

Re: unit testing gone mad

2011-06-05 Thread Stephen Price
I follow the suggested naming from The Art of Unit testing by Roy Osherove. MethodBeingTested_Inputs_ExpectedResult ie: Constructor_PassInDependencies_IsNotNull CreateInstance_PassValidJobId_CreatesInstance or whatever. I just make it up as I go along, but by following the three part template

Re: [OT] Backups

2011-06-05 Thread Stephen Price
Yeah I wouldn't use source control for backups. I remember some years ago I was using svn for my graphics... Some of the photoshop files were a few hundred meg in size (some as much as a gig) and I discovered svn hides all this stuff in hidden .svn folders. I ran out of space so fast I abandoned

Re: unit testing gone mad

2011-06-05 Thread Heinrich Breedt
The biggest benefit of proper test naming is that it forces you to think what you are testing. IMHO of course. Resharper allows you to have multiple naming styles. On Jun 6, 2011 1:35 PM, Stephen Price step...@littlevoices.com wrote: I follow the suggested naming from The Art of Unit testing by

Re: unit testing gone mad

2011-06-05 Thread Scott Baldwin
Hi Tristan, I would argue that this sort of testing is a natural part of TDD. It seems as though the author is testing HOW the class is implemented, not that the class implements the functionality that it was created to perform. At some point you have to trust your compiler, if you derive one

Re: unit testing gone mad

2011-06-05 Thread Scott Baldwin
I would argue that this sort of testing is a natural part of TDD By this I mean that I believe it is NOT a natural part of TDD... just realized this could be mis-interpreted. On Mon, Jun 6, 2011 at 3:46 PM, Scott Baldwin carpenoctur...@gmail.comwrote: Hi Tristan, I would argue that this sort of