Geeks With Blogs

News



Microsoft Store

Support This Site


AddThis Social Bookmark Button

Locations of visitors to this page

Subscribers to this feed

TwitterCounter for @sdorman

Creative Commons License


Scott Dorman ephemeral segment January 2009 Entries
Adding custom assertions to MSTest
In my last post I talked about migrating from NUnit to MSTest and mentioned that there were some Assert methods that NUnit provided which did not have corresponding methods in MSTest. For reference, those unavailable Asserts are: Assert.IsNaN Assert.IsEmpty Assert.IsNotEmpty Assert.Greater Assert.GreaterOrEqual Assert.Less Assert.LessOrEqual Assert.IsAssignableFrom Assert.IsNotAssignableFrom CollectionAssert.IsEmpty CollectionAssert.IsNotEmpty StringAssert.AreEqualIgnori... StringAssert.IsMatch ......

Posted On Saturday, January 31, 2009 9:10 PM

Migrating from NUnit to MSTest
I have been writing a lot of unit tests over the past month using the Microsoft Test (MSTest) unit testing framework that is now part of Visual Studio 2008 Professional Edition (and higher SKUs). Currently I have about 223 unit tests covering 39 classes (about 18K lines of code, 325 methods and 176 properties) with a code coverage percent of 97%. The classes that I’m testing previously had NUnit tests (although not as many as I currently have) and used NCover and NCover Explorer for my code coverage ......

Posted On Saturday, January 31, 2009 12:39 PM

Upcoming Code Camps for the South East
I’m trying to put together my speaking schedule for upcoming code camps in the South East region. Right now I just want to know when the upcoming code camps are so I can determine which ones might best fit my schedule. I only know of a few, so if you know of others please let me know. Date Title Speaking? 1/24/2009 New England Data Code Camp4 N 1/31/2009 Alabama Code Camp1 N 2/6/2009 South Florida Code Camp Y 3/7/2009 Roanoke Code Camp N 3/14/2009 Atlanta Code Camp2 N 3/28/2009 Orlando Code Camp3 ......

Posted On Tuesday, January 20, 2009 12:19 AM

How to unit test this code?
This question is for all of the TDD and unit test folks, so I’m hoping someone comes up with an answer. I’ve been writing unit tests and analyzing code coverage for one of my libraries for about a week now and I’m starting to see the end, at least for this particular library. However, I’ve run in to a problem trying to ensure as close to 100% code coverage as possible. This exists in several methods in a few different classes, but I’ll take the simplest one for illustration purposes. I have cod that ......

Posted On Saturday, January 17, 2009 10:35 PM

Unit Testing and Expected Exceptions
When writing unit tests that cover methods that can throw known exceptions, you generally want to make sure that your tests actually test the conditions that can cause the exception and that you do, in fact, throw the correct exception. Most unit test frameworks, including MSTest and NUnit, use an ExpectedExceptionAttribute to decorate the test method. There are actually several problems with using ExpectedExceptions that make it more difficult to write good unit tests. The first problem is the fact ......

Posted On Saturday, January 17, 2009 1:20 PM

Microsoft Test and Code Coverage
I have been writing a lot of unit tests lately using Microsoft Test. This included converting a bunch of old NUnit tests to the MS Test format, which was relatively painless. While examining the code coverage results (after all, what good are unit tests if you don’t know what portions of the code are being tested and not tested), I have noticed that the results sometimes lie. For example, I have a class that contains some extension methods for manipulating enums. One of those methods takes an enum ......

Posted On Saturday, January 17, 2009 12:30 PM

TweeTube – Video Sharing for Twitter
There are a lot of different sites available for sharing pictures on Twitter, but it seems like there are very few that allow you to easily share videos. All of that has changed with the launch today of TweeTube. TweeTube bills itself as being “The easiest way to share videos on Twitter” and from what I’ve seen so far, it is. You can search YouTube for videos with matching keywords, or if you already know the video you can paste the URL. After you find the video (in this case I am sharing a video ......

Posted On Tuesday, January 13, 2009 8:33 PM

Florida Technical Communities (January 2009 Update)
Florida has a very active developer community. The biggest problem we seem to have is that all of these different groups usually don't know about each and there hasn't been a "centralized clearinghouse" listing all of the technical communities. Joe Healy, one of our Florida Microsoft Developer Evangelists, maintains a list and earlier this year started putting together one-page flyers for each of the main areas in Florida. I think the eventual plan is that Joe will be updating his site to take advantage ......

Posted On Tuesday, January 13, 2009 3:09 PM

Some Clarifications on my Los Techies blog
It seems there has been some confusion and concern over my decision to also blog on the Los Techies website that I wanted to clarify. The most important point I want to make is: For those of you who subscribe to my blog hosted on Geeks With Blogs (http://geekswithblogs.net/... there is no need to also subscribe to my Los Techies blog. My primary blog will continue to be here on GWB and all new posts will show up here first. What that means is that anything I blog here will eventually make its ......

Posted On Tuesday, January 13, 2009 3:02 PM

Now blogging on Los Techies
A few days ago I was invited by the Los Techies website to start blogging with them. Have no fear, I am not abandoning my home here on Geeks With Blogs, but I will be cross-posting between GWB and Los Techies. I haven’t finished setting everything up yet, but I’ve already put a few posts out there. Be sure to check out the site. It looks to be a young but thriving online community and I’m looking forward to seeing where they take things. Technorati Tags: LosTechies ......

Posted On Saturday, January 10, 2009 5:19 PM

Reading all bytes from a Stream
I was working on some Stream extensions today and added a method which will read all of the data from a stream in to a byte array. Some of the classes which derive from Stream provide a similar method (MemoryStream, for example, provides a GetBuffer() method to do this). The drawback here is that the base Stream class doesn’t provide an abstract GetBuffer() method; instead it’s up to each individual derived class to implement such a method. This is perfectly reasonable as a stream may not have an ......

Posted On Saturday, January 10, 2009 3:24 PM

XML Comments: filterpriority
I am a big fan of using XML comments in code and actually have a few Visual Studio macros which allow me to “inherit” the documentation from an overridden member. Every once in a while, I end up pulling in a comment with a filterpriority XML tag. This tag is very prevalent in the BCL but I have never been able to find documentation on what it actually means. To see what I mean, let’s take a look at part of the definition for System.Object. In the XML comments, you will see that the class itself has ......

Posted On Thursday, January 8, 2009 8:55 PM

Copyright © Scott Dorman | Powered by: GeeksWithBlogs.net | Join free