I have Person.Surname field implemented as a string if I change the implementation of the field to a

Posted by AndyM on Stack Overflow See other posts from Stack Overflow or by AndyM
Published on 2010-03-24T23:12:58Z Indexed on 2010/03/24 23:23 UTC
Read the original article Hit count: 294

Filed under:
|

This is me going right back to basics with TDD for learning purposes.

I originally implemented Person.Surname as field of type object (the simplest possible way of passing the test.

I then added a test setting Person.Surname stating that the return value should be a string and set Person.Surname=20.

I 'fixed' the test by changing the implementation to use string rather than object. The test now long compiles due to static type checking, so I commented it out.

So I'm left with no way of leaving my intention in the test. Is there a way of having a failing test in this circumstance?

© Stack Overflow or respective owner

Related posts about c#

Related posts about TDD