tag:blogger.com,1999:blog-8336318365940619669.post1569452002017150325..comments2024-03-01T16:50:39.029+01:00Comments on Horsdal Consult: Spec Style Unit Tests in C#Christian Horsdalhttp://www.blogger.com/profile/07782376855026802670noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-8336318365940619669.post-16750483946418491482010-11-24T21:47:20.561+01:002010-11-24T21:47:20.561+01:00@dhrobbins: Thanks! Let me know how using this for...@dhrobbins: Thanks! Let me know how using this for real pans out...Christian Horsdalhttps://www.blogger.com/profile/07782376855026802670noreply@blogger.comtag:blogger.com,1999:blog-8336318365940619669.post-19580637711363709022010-11-24T15:27:38.907+01:002010-11-24T15:27:38.907+01:00This is nice. The spec style focuses your attenti...This is nice. The spec style focuses your attention nicely on what you are trying to test. The syntax with the descriptive strings is something that you could share with business analysts and perhaps technically adept end users.<br /><br />There is also a good discipline here:<br /><br />1. Write your test in descriptive English that verified by application owner.<br /><br />2. Layout your code for the tests.<br /><br />3. Test, review, test, review until green lights.<br /><br />I'm going to adopt this style.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8336318365940619669.post-37518949034561204082010-11-24T11:28:49.559+01:002010-11-24T11:28:49.559+01:00@Dennis: Using camel casing would follow .NET stan...@Dennis: Using camel casing would follow .NET standard practice, and is what I would usually do, but in this I chose not to, because I think that lower case 'should' and so on reads better right after a specification string. The point is to try to make code where the specifications inlined in that code read just like natural language, or at least close to.Christian Horsdalhttps://www.blogger.com/profile/07782376855026802670noreply@blogger.comtag:blogger.com,1999:blog-8336318365940619669.post-88572451794793749472010-11-23T22:53:29.814+01:002010-11-23T22:53:29.814+01:00very nice... I like the specs code, but the NUnit ...very nice... I like the specs code, but the NUnit code seems to be cluttered. Should you be using camel casing in the SpecExtension?Dennis Sellingerhttps://www.blogger.com/profile/17039039318920378800noreply@blogger.com