CSharpFeeds - All your C# feeds in one place.

Wednesday, January 02, 2008

When (False != False) is Evaluated As True

by Keyvan Nayyeri via Keyvan Nayyeri on 1/2/2008 8:23:56 PM

[Update: Jason Stangroome and Rich Grenwick left helpful comments. Rich has a good description of the problem, its reason and a fix for that. I applied his recommended code to BlogML test method and it passed successfully.] Some readers may remember my post about the performance comparison between two approaches that I used to unit test BlogML API especially around the list of properties for two objects that have many properties. Recently I got back to my unit testing progress and tried to impro ...

[ read more ]

To use this...or not to use this

by luisabreu via LA.NET [EN] on 1/2/2008 2:43:38 PM

I'll just start by wishing you all a great 2008! Now, to what used to be a somewhat philosophical question: should you use this to reference a member of your class in your code? Ex: should you write this.CallInstanceMethod() ? Ok, in pre-C# 3.0, I'd say NO. With the current release, I'm saying maybe! Why? Simple: extensions methods. To call them, you must always pass a reference to the type, which means that if you're calling an extension method from a class method (which is a sc ...

[ read more ]

Rethrowing exceptions and preserving the full call stack trace

by Fabrice Marguerie via Fabrice's weblog on 1/2/2008 12:14:00 PM

Did you know that depending on the way you rethrow exceptions you may lose important information? There are already several blog posts that explain and demonstrate the difference between throw and throw ex. I'm realizing only now that none of the two solutions yields the complete call stack trace information!Let's see what the problem is and I'll show you the real solution.I'll use the following method to generate an exception:private static void BadWork(){  int i = 0;  int j = 12 / i; ...

[ read more ]

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us