Tag | Unit Testing Posts

Here are the things that caught my attention in today's MSDN briefing: A. Silverlight 2.0 1. You can use IsolatedStorageFile and IsolatedStorageSettings for storing data on the client machine, but they can be disabled by users, so this case must be treated appropriately 2. Xaml power toys http://karlshifflett.wordpr... , it is a VS 2008 SP1 addin that provide powerful code generating tools on context menus for Silverlight and WPF xaml developing 3. You can access HTML DOM Silverlight, ...

This Tuesday I'll be giving a presentation on ASP.NET MVC and Unit Testing at the CMAP main meeting: http://www.cmap-online.org/Meetings/Details/2008-10-07.aspx .

I’ve been doing development professionally now for maybe 18 months and my experiences over the last 8 months in an agile shop have made me realise just how much there is to know in the development arena and, more importantly, how much I would like to know in order to be really creative in my job and produce truly excellent software. In my previous job, I used a text editor to write Perl. There was no such thing as unit testing and copying and pasting was viewed as an aid to productivity rather than ...
It is generally considered a good thing to use unit tests these days. Often it is necessary to test a method which takes some complex type. So in the unit testing one has to painstakingly manufacture such object, and pass it in. Before doing so, you would (should!) ensure the complex type itself produces an identity - that is to say that if you create an instance of type MyClass and assign / construct it with proper values your should "get back" what you gave it. This is especially true for object ...
[Source: http://geekswithblogs.net/E... We had an interesting problem which looked at first like a Parallel Convoy situation – the source was sending message segments which we needed to build up into a whole message and send on to the target. The source segments would be arriving in any order, and the sequence wasn't important – each would contain just one part of the whole message. Initially we knew the number of segments per message, so a straightforward Parallel Convoy was the obvious ...
Winnipeg has had a successful .NET User Group for many years, and building on that we’ll be providing a new offering starting this fall: The Winnipg BizTalk User Group! When and Where October 9th at 5:30 17th floor Richardson Building (where we currently hold the .NET User Group meetings) What will be discussed? Introduction to the group, introduce who’s involved, etc. Shona Helstrom from EDS will be presenting on using BizUnit for unit testing BizTalk We’ll conclude with a roundtable discussion ...
Microsoft announced BizTalk Server 2009 today, and gave the green light to talking about the new version. It’s due for release in the first half of next year, and is shaping up nicely. Microsoft is casting BizTalk Server 2009 as a major new version in its own right, rather than just an updated 'release' of BizTalk Server 2006. This is an important move, and one I strongly welcome. There is certainly enough in BizTalk Server 2009 to warrant thinking of it as a major revision of the product, although ...
Koen Zwikstra updated SLSpy with Reflector, Alan Cobb on sizing the NBCOlympics videos, Page Brooks on a great carousel, Jeff Wilcox with a Unit Testing primer, Jonas Follesø with updated SL/WebCam and Sliding puzzle, Jesse Liberty compares animation types. I've exchanged email with CrocusGirl a couple times about this... she used the Andrea Mosaic tool to create a DeepZoom to celebrate her One year of California adventure. Another great example of this technology... From SilverlightCream.com: Silverlight ...
Employee Info Starter Kit is an asp.net starter kit, which demonstrates the use of simple CRUD operations for maintaining a company's employee information. It has been developed by me as a guideline for building enterprise level projects. In last few months this starter kit placed in the top chart at code.msdn.microsoft.com for several times regarding the popularity. A very exciting news for all of Employee Info Starter Kit fans is yesterday this starter kit has been placed in the front page of Official ...
Testing the Casino The July meeting of the Roanoke Valley .NET User Group was one of the best ever! During the summer months, user group attendance is usually low. Therefore, we try to have meetings that are a little less formal and require less preparation for the presenter. This July we not only had a HIGH ATTENDANCE but we had 100% MEMBER PARTICIPATION during the meeting. Here's the formula: Take the Black Jack Starter Kit Add Bugs Deliver a brief presentation on Unit Testing in Visual Studio ...
The Roanoke Valley .NET User Group held a monthly meeting tonight. The topic was Unit Testing with Visual Studio 2008. It was arguably one of the better meetings we have held. Even though I have been using Unit Testing for years (starting with JUnit forever ago). Although I feel that I perform unit testing well enough, I am amazed and how much I can learn in just a few hours by collaborating and interacting with others. It seems that over the past 7 years or so I have performed a significant amount ...
“Foundations of Programming, Building Better Software” is a new eBook by Karl Seguin. The book does not say in its introduction that it’s all ALT.NET-ish, it starts by introducing what ALT.NET is, it's goals etc, afterwards, all the topics the book covers are inspired by ALT>NET frequent topics. This includes Domain Driven Design (DDD), Dependency Injection (DI), Object Relational Mapping (ORMs), Mocking, etc… Here’s what Channel9 had to say about it (which is how I originally found it too): Karl ...
Here's a little method I came up with recently to test the execution of events. You may not ever need to test to see that an event fires, because you have some other state that you can check. However, that is not always the case. Here is how I approached it using the unit testing provided with the developer's team editon of Visual Studio. The first thing I did was add a wait handle object inside the definition of my unit test class. Specifically, I chose a ManualResetEvent for the most control, but ...
I have been really busy between starting as a Principal Consultant for Headspring Systems and a long awaited vacation. I am justcatching up on some blog posts.My Silverlight Unit Testing session at the Austin Code Camp 2008 went really well. The source code and presentation is available for download here.I got some great feedback and look forward to being able to speak on the topic some more! I wanted to formally thank John Teague for all of his hard work organizing the code camp. With a new baby ...
I hosted a BOF session at Tech Ed Developers 2008 on ‘Creating a Culture of Quality’, and one of the topics that came up was unit testing. One developer talked about how she wanted to get unit testing happening at her company, but because they did embedded applications using C++ she wasn’t sure what the options were…and neither did the rest of the group. I checked with some fellow Western Canadian devs to see if they had any ideas and two products seemed to be at the top of the list: CppUnit and ...
The good folks at SlickEdit® hooked me up with a review copy of SlickEdit 2008 Professional, and I gotta tell ya I was pretty surprised. I didn't really know what to expect. I guess I just expected a less feature-rich Visual Studio, but that's definitely not what I found. First of all, I wouldn't consider SlickEdit to be a competitor to Visual Studio. It's more of a multi-purpose polyglot programmer's editor on steroids. First, on install, it asks about your editing environment emulation. This is ...
Some of the great and useful tools available at codeplex site for biztalk developers. I listed down few of them here. BizTalk Server 2006 Documenter Creates compiled help files for a given BTS 2006 installation. BizTalk Server Pipeline Component Wizard A project meant to ease to development of pipeline components used within a BizTalk Server environment. Supports both C# and VB.NET BizUnit - Framework for Automated Testing of Distributed Systems BizUnit is a test framework that is intended to test ...
Using the VS2008 unit testing framework, if you want to check for an expected exception, sometimes your test will pass because the exception was raised by another line of code - after the line you were specifically trying to test. To resolve this you have to manually check for the expected exception - using a try-catch block. However there is a catch (excuse the pun).... Microsoft.VisualStudio.Test... will not fail when types are different as long as the actual ...
I'm in TechEd at the moment and I am sitting in a presentation on Unit Testing. Unit testing is something we have been doing on my teams for some time now and it is an intricate part of our development process. I am a big believer in continuous integration for development and part of the automatic build process includes a unit test run through the application/component that we are working with. The results of the unit tests are then deployed (automatically as well) to a server and made accessible ...
Jeff Paries with a SL2 Tweemes Client, Tim Heuer on Streaming, Cross-Domain data, VSM, and Skinning, Jesse Liberty on SL2B2 Event Bubbling, Christian Schormann on VSM and Skins, and Jonas Follesø on Unit Testing SL. From SilverlightCream.com: Silverlight Twitter Jeff Paries has a great job.... Look at what he's gone and done now!! .. this is very cool... thanks for sharing Jeff! Silverlight Streaming won’t upload my video! Tim Heuer has 4 things since I posted yesterday! ... this one is on the various ...
UPDATE (6/20/08): If you are at all confused about some of the techniques outlined in the blog posts by Udi and Ayende I discuss below, specifically about their multithreading-capabilities, you might want to check out my future post here. --- One of the first issues I have already found myself having to deal with in my game is the idea of how messages will be sent "from the entity" (since the entity is ultimately in charge of when something happens, and thus must trigger a message being sent), without ...
I began the third and final day of JAOO Brisbane by arriving late. I had left my name tag at home so I had to go back for it. I was in time for Robert Martin's keynote Clean Code. Uncle Bob is well known for his enthusiastic, entertaining presentation style. I greatly enjoyed his talk, even though it was really just a back-to-basics on writing code. He did a tutorial on advanced design that I missed, but I'm sure it would have been excellent. Next was Jim Webber speaking about distributed programming ...
Mock object is basically a mirage of the real object as they posses the same qualities by don't do anything. Mock objects really shines when working with some entity that continuously changes like time, temperature, air speed etc. In this post I will introduce mock objects and how can they be useful when unit testing such entities. I took the idea from a great article published on AspAlliance. The article "Beginning to Mock Using Rhino Mocks and MbUnit" is written by Ben Hall. The idea is that we ...
Technorati Tags: Silverlight,Unit Testing,Test Framework Working with the Silverlight testing framework the last three weeks has been interesting. I ran into a crazy intermittent bug which drove me made for about 2 hours. The usercontrol that I was adding to the TestSurface would be visible about 50% of the time when running my tests. The test would still run and I could hear the audio portion of the videos that were playing as part of an integration test, but the Controls were not visible on the ...
Time for another adventure in F#, covering some of the basics of functional programming and F# in particular. Today we'll manage to look more at regular .NET integration and .NET programming. With the previous efforts, we've looked more at functional programming and in turn F# specific things, but want to show that you can do anything normally in F# that you can in C#. To me, F# is the perfect all-purpose language because it can do a lot of the things C# can do, but in turn, F# can do things much ...
There's no denying that the MVP summit is a great time of socializing and partying...everyone gets together with their peer group and has a good time. I'm hoping though that through this week there will also be some time to "get work done". I have some things I'd like to raise with other ASP.NET MVP's and also community leaders on a whole (most MVP's happen to be community champions). How do we inject good coding practices for existing ASP.NET webform dev? I was talking with someone after my TCCC ...
Continuing the series on recommendations for testing with BizTalk this post will focus on how to effectively test custom adapters developed by your team and for use within a BizTalk solution. As most of you will be aware adapter development is probably one of the most difficult development tasks in the BizTalk arena because it is often easy to get the functionality of the adapter to work, but once you put it in a production like situation you will often discover a whole new set of problems. Based ...
Michael Washington provides a Hello World SL2/DNN, Karen Corby has part 1 of 2 on SL2 and Networking, Laurent Bugnion talks about SL2/JS/Unit Testing, DeepZoom Composer Forum from Expression BLog, Andy Beaulieu's material from a SL2/Data CodeCamp talk, Adam Kinney on SL2 Sidebar Gadgets on Vista 64, and LeeOnTech with a Silverlight Wizard. From SilverlightCream.com: DotNetNuke Silverlight Hello World Michael Washington decided to start at Hello World with a DNN/Silverlight 2 series... he's been doing ...
One Line Statement Microsoft's IoC container Unity, hosted on CodePlex as an Application Block for Enterprise Library is now released in ver. 1.0. Introduction If you do not know what IoC is, you might want to check sample articles: The semi standard Dependency Injection (DI) and Inversion of Control (IoC) article by Martin Fowler (Tip, read as much as you can from this guy's writings - and thank me for suggesting it) [Warning: Not .NET Specific] Understanding IoC Container (Simple "down to code ...
Andy Leonard visited the RV.NUG for the April monthly meeting. With Andy it's always a visit with a presentation. I've known Andy a long time and he was instrumental in helping me (and the RV.NUG) network beyond the Roanoke Valley. While visiting, Andy gave a presentation on "Testing the Database". Even though it was a nasty, dreary, rainy night we had a good turnout and a lot of questions for Andy. Andy's gotten to know several of us so he jokes with the person asking the questions; it makes for ...
Michael Sync posted a list of SL2B1 problems, Rob Houweling produced a Motion Blur demo, LeeOnTech with a SL2 MasterPage proposal, egoZd on uploading with SL2 and asmx Web Services, Laurent Bugnion's bug tracking of the ScrollViewer, Scott Guthrie on Unit Testing, and 4 very cool articles by Karsten Januszewski. Lest I forget, everyone should go watch the Silverlight Rehab video... this is hilarious! From SilverlightCream.com: Silverlight 2 (beta1) Known Issues and workarounds (if any) Michael Sync ...
So I have extra batteries on hand. Ready for the love of Silverlight2. Getting Video and trying to encode as fast as I can for the streaming. Woooh! Mix08. See the twitter feed for instant updates. www.twitter.com/mikedopp. Ray Ozzie Main points in keynote:Content, Commerce, Community. Making cracks about the yahoo purchase or working on purchase. Media Zune, PC, Xbox360 working better together. Xbox360 might finally get a the web? Microsoft going google docs with word excel and such Office Live ...
I keep getting this error in Visual Studio 2008 on Vista: I'm not sure what the issue is, but if you get this error, just stop the VSPerfMon.exe process and you can continue testing without rebooting your computer. Technorati tags: .NET, Unit Testing, VSTestHost, VSPerfMon ...
The Problem In an N-tier application, you keep your logic in a business logic tier, typically a different VS project that can be used from a website, a windows service, or desktop application, and that should be valid to writ unit tests against on its own. But how about if your requirements say that you need to to upload some file for the business logic to work? Think of a scanned image (signed contract maybe?) or just a comma separated value file containing some emails. Typically the business logic ...
Note this article is primarily based on Microsoft/.Net technologies, although the principle apply to any technology. Before development of any reasonable business software project begins the following areas need to be nailed down: Application Architecture (application structure) ORM (Object/Relational Mapping - data source access and translation to/from business objects) Base framework (system framework, helper classes, base classes, etc) UI. There are many tools available that will dictate or guide ...
All of us have probably written code like this: Foo f = new Foo(); And what could be simpler? As long as the logic in the constructor is simple (or better yet, the constructor is empty), it would seem that the simplest code is the best, so just use the constructor. Certainly the MSDN documentation is rife with code that uses public constructors. You can probably find plenty of public constructors used right here on my blog. Why invest the effort in writing (and using) a factory class that will probably ...
Some time back I blogged about unit testing Membership Provider "Membership Provider and Unit Testing" as it turned out I was missing the unit tests for Role Provider. In this post I will explain how to unit test the Role Provider. First of all here is the implementation of the role provider. public class VirtualRoomRoleProvider : SqlRoleProvider { private NameValueCollection _roleConfig = new NameValueCollection(); public VirtualRoomRoleProvider() { _roleConfig.Add("applicatio... "VirtualRoom"); ...
God I love writing Unit Tests. I either find bugs in code, bugs in my unit tests (darn cut and pastes), or bugs in my head. Let me explain in a second. I like TDD. I also like, TAD (Test After Development) or the one I use the most these days: TASAYC (Test As Soon As You Can) The benefit of using TASAYC, is that you're creating unit tests about code you haven't touched in quite a while. You either write the wrong unit tests because of "bugs in my head", the wrong unit tests because of assumptions ...
I was looking for ways to improve our development process when I stumbled across the Framework for Integrated Testing (FIT). The rest of this post is the body of an email I recently sent to my manager. The goal of the Customer update is to migrate all their customizations to a new framework in a reliable and quick manner. The major risks I have been able to identify are as follows: Developers won’t be able to identify all the behaviors that need to migrate. Requirements are scattered. Code is not ...
Long time ago I posted an article "Creating an Online Exam Using LINQ to SQL Classes Part 1" in which I explained how to get started with creating a very simple online exam. I just posted the Part 2 of the article which covers unit testing of the application ...
Recently among other places it was asked on the altdotnet list about the strategies of unit testing with regards to assemblies and naming This message here caught my eye regarding putting your NUnit tests in the same assembly as the code under test. The message states about putting the tests in the same assembly : There are a couple advantages to this approach: The nearness of the files will make it easier (and therefore more likely) that developers will work on the test in tandem with the class ...

I am little behind the times when it comes to unit testing and so I'd like your recommendations for what you use and what you like dislike about unit testing you .net code - discuss.

Build automated unit tests for your identity management solutions just like you would a normal development project. Trust me. Here's why: Test Driven Design: design your test first. do your craft until the test passes. Comfort and assurance: you know because you've run them 1001 times. others can run them too. Free documentation: requirement and business rules can be inferred from the test cases. Fix problems instead of looking for them: you will spend almost no time looking for defects Yes, it requires ...
I have been working on some new videos for AspAlliance which will be posted on the website on weekly basis. Here are some of the upcoming and new videos: 1) Introduction to the Dynamic Website Project 2) Unit Testing ASP.NET Pages Using WatiN 3) Unit Testing ASP.NET Pages Using Watir 4) Introduction to the ASP.NET MVC Framework 5) Implementing MVP Framework for ASP.NET Application You can find the complete list of videos at www.aspalliance.com/videos Enjoy ...
When creating my unit tests, I've been a big believer in the Object Mother pattern for creating state for my immutable value objects. Basically, I need to put the objects in a valid state in the constructor. Doing such is usually a pain, however. Before the ObjectMother pattern, you had code similar to this to create an object in valid state, such as a medical claim. Remember that we need hundreds of these to capture the variations in our model for our tests. Claim claim = new Claim( new DateTime(2008, ...
Part of my job is not only to design and implement solutions for my customers, but also to make my customer's developers stronger as well. During these customer engagements, there are many times when junior developers are involved. My job is to help those on the team to be stronger and then in turn help become leaders. Where to start? Well, I could start with a stack of point technology books (ASP.NET, SharePoint, BizTalk, etc) that become obsolete right during their printing, so that's not where ...
Sometimes back I wrote a blog post about Unit Testing Membership Providers. Yesterday, I had to do the same hence I turned back to my post but unfortunately I could not figure it out. After banging my head for several hours I finally figured out the problem. This post describes everything you need to do in order to unit test your providers. First create the custom provider which you would like to test. Here is my custom provider. My custom provider is created in a separate class library project. ...
For the past couple of years, the Model View Presenter pattern has gotten a lot of attention on the .NET platform and more in particular to ASP.NET. For a thorough introduction on MVP with ASP.NET, read the article on CodeProject by Billy McCafferty. Recently, it has come to play that many now favor the Model View Controller (MVC) pattern over MVP. If you're confused about the differences between the two, check out this post which will explain it well. The basic gist is that the MVP pattern gives ...
I've been playing around with mock objects using Rhino.Mocks for the last few months, but today was the first time that I had an unfettered coding win and became a true convert. I was introduced to NUnit about five years ago from a co-worker (thanks Dewayne) and gradually became a true believer. Unfortunately, I was a late-bloomer in the area of mocking, so by the time I finished my last big project I had left a suite of about 500 database driven tests that took almost 2 hours to run and were a maintenance ...
The Rockville .NET User Group (ROCKNUG) will hold it's meeting on 12/12 from 6:30-9PM. This month will cover MbUnit, a favorite tool of mine, by Jay Flowers. Listed below are the details: Release 1.6 Wednesday, December 12, 2007 6:30-9:00 PM Montgomery College, Rockville Humanities Building - Room 103 MbUnit by Jay Flowers In this talk Jay will introduce you to some advanced unit testing techniques. MbUnit offers easy ways to create parameterized unit tests. He will explorer fixtures like the RowTest ...