Tag | Unit Testing Posts

Tomorrow, I will be speaking in Grand Rapids at the Silverlight Firestarter. It is a one day event intended to get people bootstrapped with Silverlight. I will be giving the “Advanced Topics” presentation. I have decided to run it as a series of “Lightning Talks”. The idea is to give a lot of breadth so you know that the topic exists and move quickly between them. To go along with the talks, here are a bunch of links that you might find useful: MVVM http://msdn.microsoft.com/e... ...
In this Issue: Rénald Nollet, Roboblob, Laurent Bugnion, Timmy Kokke, Michael Sync(-2-), Victor Gaudioso, and Bill Reiss. Brought to you from a tiny table in my no-tell-motelTM in 'Vegas AKA "cheaper than anywhere else" and the WiFi is free and smokin'... From SilverlightCream.com: Sync your Silverlight out-of-browser application data without service but with Dropbox Rénald Nollet is in good company (Walt Ritscher) because he's demo'ing synching OOB apps with dropbox. Unit Testable WCF Web Services ...
In this Issue: Phil Middlemiss, Robert Kozak, Kathleen Dollard, Avi Pilosof, Nokola, Jeff Wilcox, David Anson, Timmy Kokke, Tim Greenfield, and Josh Smith. Shoutout: SmartyP has additional info up on his WP7 Pivot app: Preview of My Current Windows Phone 7 Pivot Work From SilverlightCream.com: A Chrome and Glass Theme - Part I Phil Middlemiss is starting a tutorial series on building a new theme for Silverlight, in this first one we define some gradients and color resources... good stuff Phil Intercepting ...
In the first step towards implementing a BizTalk 2009 environment, from development through to live, I put forward a proposal that detailed the options available, as well as the costs and benefits associated with these options, to allow an informed discusion to take place with the business drivers and budget holders of the project. This ultimately lead to a decision being made to implement an initial BizTalk Server 2009 environment using the Standard Edition of the product. It is my hope that in ...
Time for another guest post (check out others in the series), this time bringing together the world of mocking with the world of Entity Framework. A big thanks to Moses for agreeing to do this. Unit Testing Entity Framework Dependent Code using TypeMock Isolator by Muhammad Mosa Introduction Unit testing data access code in my opinion is a challenging thing. Let us consider unit tests and integration tests. In integration tests you are allowed to have environmental dependencies such as a physical ...
Unit Testing with VS2008 Team System and Moq In order to loop around the software development life cycle, you do really have to do the unit testing. Once you get in this stage, you will realise that you need to get your hand dirty with heaps of isolation and refactoring and you wish the whole team had been practicing the Test Driven Programming. It is vital that you test your application and the more dependencies you have in classes, the deeper nightmare for isolation. Possibly in some cases, bad ...
Employee Info Starter Kit is a ASP.NET based web application, which includes very simple user requirements, where we can create, read, update and delete (crud) the employee info of a company. Based on just a database table, it explores and solves most of the major problems in web development architectural space. This open source starter kit extensively uses major features available in latest Visual Studio, ASP.NET and Sql Server to make robust, scalable, secured and maintainable web applications ...
Coming from someone who loves the KISS method, I was surprised to find that I was making something entirely too complicated. I know, shocker right? Now I'm no unit testing ninja, and not really a WCF ninja either, but had a desire to test service calls without a) going to a database, or b) making sure that the entire WCF infrastructure was tip top. Who does? It's not the environment I want to test, just the logic I’ve written to ensure there aren't any side effects. So, for the K.I.S.S. method: Assuming ...

V3 of the MVVM Light Toolkit was released during MIX10, after quite a long alpha stage. This post lists the new features in MVVM Light V3.

Compatibility

MVVM Light Toolkit V3 can be installed for the following tools and framework versions:

Read the rest of this entry »

The problem statement: I am tired of thinking how to show a simple message box or user prompt and act based on the response in Model-View-View-Model (MVVM). Common approaches: - It's ok, let's just do this one thing from ViewModel and mock this out for unit testing - Design my own dialog, then what to do from there - Can I write something in view code behind, ah yes, that seems to be the only way out, as anyway MVVM is still not matured... - and what not? I am pretty much one among the few frustrated ...
On Monday the PnP team released the 2nd drop of the SharePoint 2010 Guidance. Included is an example of a sandboxed solution, which is a good list aggregation scenario related to SOW’s (statements of work) and estimates across a number of sub-sites. I am VERY excited about the work that is being done and guidance documentation and code that will be released soon. You will also begin to see tests utilizing Moles for “detouring” or “mocking” as well as examples of tests using several different unit ...
I came across and found very useful, bare in mind I am relatively new to the EF and TDD so any suggestions would be welcomed. I have been very busy recently with a new project, as I am in control of this project I have wanted to do things correctly from the start, I also am using it as an opportunity to get familiar with all the newest and shiniest of Microsoft's technologies. The platform is using a combination of ASP.Net MVC 2.0 and the Entity Framework 3.0. Because I know this codebase is going ...
This morning, very early (or very late depending how you see it), I learned that one of the sessions I submitted to the MIX 2010 open call for speakers had been picked by the public. Out of 169 sessions, only 12 were picked, so you imagine my feelings right now. Honestly, I am sure that this will be a good session, but it could have gone either way, and I had prepared myself mentally for the alternative possibility too. Read the rest of this entry » ...
This year Microsoft decided to have an open call for sessions for the MIX 2010 in Las Vegas. This conference, in case you don’t know it yet, is a great 3 days about modern client technologies, such as ASP.NET, Windows Presentation Foundation and of course Silverlight. This year, MIX is taking place from the 15th to the 17th of March 2010 in the Mandalay Bay hotel in Vegas. Today, the voting began! I didn’t count them, but there seems to be more than 100 sessions lined up, and the competition is fierce: ...
Previously I wrote an article regarding Unit Testing WCF with Unity. Unit testing allows you to test a single component of your application, completely independent of any other components or systems. Once you have successfully created your unit tests, the logical next step is to see how your service works when connected to other components. These integration tests allow you, for example, to run tests against your service and see how it behaves when writing to a database or consuming another service. ...
In this Issue: Jeremy Likness, Rudi Grobler, Nick Kramer, Fredrik Normén, Mike Taulty, Deborah Kurata, Shayne Burgess, Glenn Block(2), and Gill Cleeren(2). Shoutout: Did you know MIX10 registration was open? Register by Jan 15th and get in for $795!! MIX10 From SilverlightCream.com: Unit Tests for ViewModels AND Views in Silverlight Confused about Unit Testing Silverlight apps in MVVM? Jeremy Likness isn't... and he shows us how! Blend 3 Tip: Filter resources by selected element Rudi Grobler has ...
So you're familiar with TDD (test-driven development)... Failing your tests first, then building up your classes to satisfy your tests so they're all "Green"... This is a typical scenario and is pretty straightfoward with .NET. Well now you have to create a WCF service and implement unit testing to ensure you don't break your service when you build out a new version. This is a bit more challenging but you do have some different options: Separate out your service code into a library and run your tests ...
MVP in Action - Unit Test Read the post here..geekswithblogs.net/ra... Synopsis This is in continuation to the article geekswithblogs.net/rajeshpi... This post will deal with writing simple unit test case for the "User" user creation use case we covered in the above blog post. Background Unit testing means testing a piece of code or a method. White unit testing we need to stub or fake out external dependencies so that the test can ...
Recently my company just released the first version of a new MVC web site: AlbumCredits.com. This project, led by Oskar Austegard, is was I consider a highly successful real-world implementation of MVC. In a time when most music these days is downloaded, the production and performance engineers, and recording professionals that work on the music don’t always get credit because there is no CD booklet to look through. Album Credits is almost like a LinkedIn for recording professionals. From the about ...
Gil Zilberfeld from TypeMock: As you may know by now (from my tweeting or by looking on the DotNetRadio schedule listed on the site) there is an upcoming interview with Gil Zilberfeld from TypeMock. He will be on the show at 5am PST. Please send in your TypeMock and unit testing questions for him. The submitters of any questions that I use on the show will get some DotNetRadio swag! Jeffrey Palermo from Headspring Systems: What you may not know is that I am scheduling an interview (possibly tomorrow) ...
It is Friday 13th Nov 2009 - which means it is the last day of TechEd Europe in Berlin. Overall I have had a good week – high quality sessions, lots of time with customers and colleagues and a very smooth conference throughout. I spent the week doing a bunch of things. 9am Monday I was presenting on Entity Framework 4 after 4 hours of sleep and using a brand new VPC after my original failed to load following yet another blue screen from the host (the machine will be flattened next week – perhaps ...
In an effort to continually improve as a developer, one of the things I do is read lots of books. Recently I read ASP.NET MVC in Action by Jeffrey Palermo, Ben Scheirman, and Jimmy Bogard. In short, I consider this a “must read” for anyone who is serious about developing with the ASP.NET MVC framework. I’ve heard some people say that this should not be your first MVC book because it is more advanced than other MVC books available. While I can understand that logic to a degree, I think it would be ...
Thanks to everyone who attended my “MVC in the Real World” presentation at CMAP Code Camp today. The code as well as the PowerPoint can be downloaded here: MVC in the Real World Download I also had a few other requests during the talk. First, I had a request to post the code as it looked at the very beginning of my talk before I modified anything. You’ll find that link on the download page above as well (file name: PersonalInfoManager-ReadlWo... Second, I was asked about a couple of ...
<< Part 2 – A quick look at IronRuby Gambling with Cucumbers In part 2 we demonstrated how we can mix .NET and Ruby though IronRuby. The question is, why would you want to do that? It is probably easier to stick with one language for most projects. Why combine them? The problem with BDD in .NET One area where Ruby currently has a clear advantage over.NET is in the realms of Behavioral Driven Development (BDD). You can write Unit Tests and Integration Tests in .NET just fine, but what about ...
Every now and then, I end up writing and re-writing the same code (or very, very similar) to achieve a functionality that I’ve had before. Sometimes I can remember where I wrote it, so I can just copy and paste. At other times, I have to redo it again since I forgot where it was. So I’d like to put it up on my blog so I have access to it. If anyone else gets to see it and can use it, so much the better for everyone. Of course, I’d also accept criticism to the code too . So, this is my first one; ...
I love Test Driven Development. I use this development approach wherever I can. It makes my code a lot better and gives me the confidence that I indeed have crafted a good and reliable piece of code. However, some things are quite hard to test-drive, simply because they have so many dependencies that you would need to make extensive use of a mocking framework (and probably inspecting some things via Reflector...). In such a case, you usually decide to not have unit tests, because the time and amount ...
In this Issue: Jeff Handley, Jeremy Likness, Gavin Wignall(2, 3, 4, 5), Mark Miller, Nigel Sampson, and Microsoft Expression Product Site. Shoutout While not a complete solution, Koen Zwikstra had done an OOB solution for Silverlight a while back and now he's giving up the source: Hosting Silverlight outside the browser (sourcecode). Forget all those weight-loss gimmicks! I worked Monday the 12th, took off the 13th and felt worse all day, was at the Dr with flu symptoms on the 14th... ended up with ...
Most people can agree that testing your software is a good thing. Most developers will agree that unit testing is a great thing to have. But how about testing your web site? Fair enough you can run unit tests on your code behind, but unit testing a GUI can be problematic. If you struggled with this problem, don't worry - you're not the first! I've recently become aware of Selenium. Selenium is a very powerfull tool for testing web applications. It gives you a lot of nice features to help you test ...
One of the big complaints with the version of Windows Workflow Foundation that shipped in .NET 3 and .NET 3.5 (WF3) was that it was very difficult to unit test workflows. Unit testing workflows was not impossible, but it was very difficult and required a lot of code to setup the workflow runtime and manage your workflow. Since unit testing workflows in WF3 was clumsy and awkward, many developers chose to either not unit test their workflows, or just avoid using WF3 all together. I am very happy to ...
[Amazingly – I actually got this podcast done before the MSDN Flash newsletter it accompanies :-) Despite my hoster trying very hard to turn my hair grey to get this posted! Grrrrrr. ] [Apologies in advance if you have problems downloading it. I am working right now on getting this series of podcasts up on http://channel9.msdn.com/ to give a much more reliable download provider. If you do have issues you can grab it from my Skydrive] This podcast is an interview with Tom Quinn in which we start off ...
Let's face it: Setting up NHibernate is not one of the easiest tasks. You need a good knowledge of the system, and you need to write some configuration xml to your config files (well, normally). This is not such a big deal for the main project, since you only have to do it once in a project's lifetime. But you also have to care about setting it up for each and every test project that uses NHibernate, and there might be a lot of them if you're consequently unit testing just about everything. So, wouldn't ...
Download Sample Code MVVM Playground Have I mentioned lately that I love the MVVM presentation pattern?? If I haven’t please allow me to do so now. It makes unit testing much much easier, the clean separation between logic and presentation makes me feel all warm on the inside, and (Blendability) those designers in the black turtle necks can run off and build an awesome UI in XAML while us devs write our code in peace :) Ahhh, so ok there are some issues that we are going to run into in the MVVM space. ...
Almost every software project comes with a database. Sometimes it will be developed from scratch and in parallel with the actual domain model for a new (aka. 'greenfield') project, sometimes it will be a pre-existent datastore provided by the customer or coming from an already running software that has to be extended (then we can call it a 'brownfield' project). In either case, you will likely end up with a bunch of database scripts that need to be executed as part of your installation process. I ...
I have finished a couple of books that I would like to plug here. One is “The Art of Unit Testing” and the other is Regular Expressions Cookbook. I waited for both to drop, and as soon as they did I picked them up. The Art of Unit Testing The Art of Unit Testing (TAoUT) has received many awesome reviews with some folks guessing there may be a *DD book coming out soon by the same author. Well see, and it would be nice to have a compilation of *DD guidance for those that can dig(g) and use a *DD form. ...
This week I had a need for NUnit based unit testing against a class that depended on a provided SqlConnection. Up to this point I had been able to mock external objects and their behavior based on interfaces, but with a SqlConnection I could not mock. There are some options for mocking the SqlConnection such as TypeMock, but I needed a realistic connection to test against. This also proved as a good method for building the expected DB interface. The solution that worked best for my environment (only ...
It's been years now that unit testing frameworks and tools have grabbed our attention, made their way into our favorite IDE and sparked yet another wave of seemingly endless "my framework is better than yours" wars. And then there are the principal wars of whether TDD is better than Test After Development. And most excitingly the automated testing tools etc. Oh, and let's not forget mocks! So we have all the tools we need – right? Well, kind of, no. I recently attended a talk by Llewellyn Falco and ...
Introduction: In this post, I will explain you how can we write a unit test in c#. It is a basic guideline for those who wants a quick start. Unit testing is an integral part of any software that is developed. It is an advantage which most of us are either not aware of or we are neglecting it. It actually helps a developer to write error free code. To write unit test, we will first install a unit-testing framework. About Unit-Testing Framework: Well, Unit-Testing Frameworks are useful to simplify ...
In this Issue: Ian T. Lackey(2), Shawn Wildermuth, David Anson, Jesse Liberty(2), Scott Marlowe, Gavin Wignall, Brad Abrams, and Robby Ingebretsen. Shoutouts: John Papa's latest article is available in MSDN Magazine: Binary Encoding and Handling Faults in Silverlight 3 Stefan Olson has his own version of: Bugs fixed (or not) in Silverlight 3 RTW David Kelley has announced an MSDN Webcast: geekSpeak: Composite Application Development (Level 200) András Velvárt gave me this link which is a promo for ...
When I recently started looking through a certain project’s tests, I was struck by how difficult it was for me to read and understand. The tests were laid out haphazardly, and the code contained enough logic to make me wonder if it would be easier to analyze the functional code. Tests don’t do anyone good if they require that much analysis. In contrast, one of my favorite open source projects contains tests that allow me to learn the functionality of the system without looking at any functional code. ...

I've only been at the new contract 6 weeks and I've already have them using NUnit, Lightweight Test Automation Framework, and today I got them to set up TeamCity!

Before I started they were not using any automated unit testing suite and no they joined the dark side :)

My Pex has not flexed recently. Peli has dropped a new version of Pex with a few breaking changes and I’m two revs behind him on implementing. One thing that I’ve come to realize is that I can’t manage the churn taking place for the code under test. The last few sprints have introduce large amounts of change in our persistence model and that, well, just screws the pooch when you’re trying to keep things updated. I’m trying to figure out the best way to manage the churn in my testing libraries – and ...
The Way I've Come To See BDD Over the last year and a half, I have been moving from TDD to BDD. For those who don't know, this is not a tool or technology switch so much as it is a mental paradigm shift. Luckily, I didn't work in a lot of shops that ever did a lot of unit testing (testing units of code after you write them). Most often, we'd be under time crunches that forced PMs to make the decision to forego unit testing in order to meet a hard deadline that they got from some estimation crystal ...
BDUF was especially interesting when I heard Peter Provost and Billy Hollis speak on this topic during their presentations at the PnP Summit last year. Both made points that I could definitely relate to. You see the (embarrassing) thing about this post is that I didn’t know what BDUF was, and was living it everyday, but waterfall was supposed to be OK? I never heard anyone say BDUF until I hooked up with .NET a few years ago (I wrote my first line in December of 2003), even having done a few tours ...
In this Issue: Cristian Merighi, Walt Ritscher, Al Pascual, Vijay, and Faisal(2). Shoutouts: The Mashooo folks have the winning entries up for their S Prize contest. I'd like to thank them for the honor of participating as a judge. I didn't look at any of the games prior to going through the 10 finalists because I didn't want to be swayed. Since I was a judge I won't comment on the winners, but I will say I'm not disappointed :) Check them out ... the other 7 are all winners also! Mashooo S Prize ...
I just completed my first iteration on a project I was injected into at work. What makes this project interesting is the approach to software development as well as the technology makeup. Many developers wonder what its like to switch from traditional methods and adopt something like TDD or OSS tools like nHibernate, Rhino Mocks, Castle Project, etc. I wanted to share some thoughts and what my experiences have been after completing my first iteration in exactly that type of environment. TDD – Different, ...
Microsoft Community in Bangladesh proudly presents Microsoft Day @ Dhaka. This is a special day dedicated to all Microsoft technology professionals and students in Bangladesh. We will be having the best Microsoft community technologists from Bangladesh - Microsoft Most Valuable Professionals (MVPs) delivering sessions at the event. This technology marathon is a great opportunity to learn from the best and network with each other. Both Microsoft developers and networking professionals would find the ...
In this Issue: Patrick Cauldwell, Erik Mork, Dan Wahlin, David Poll, Peter Bromberg, Steve Strong, Jonathan van de Veen, Michael C. Neel, and Jafar Husain. Shoutouts: Pete Blois reports that he has Updated Rooler ... if you haven't used this, go get it now! From SilverlightCream.com -- 9 items since some folks got delayed a day: Default button semantics in Silverlight revisited Patrick Cauldwell revisited his Default button code I blogged a couple days ago and has made it Prism-friendly. It depends ...
A couple of notes about my environment that I didn’t state before. The laptop I’m use is a typical laptop 4Gb of memory standard dual-core, with 64-bit Vista Ultimate as the OS. There don’t appear to be any limitations Pex in on 64-bit, but there are a few messages you’ll see on the dashboard that state that Pex Explorations are going through some kind of “(x86) cold-start”. The first time saw this I thought that I might need to spin up a test project on a 32-bit VM, but it works fine on a 64-bit ...
When unit testing you sometimes need to test that values are being set to the correct literal/constant value - and this value is often stored in a resources file. However, for some reason the VS2008 'Create Private Accessor' feature did not work for me for resources (maybe be cause they're all static properties and the generated _Accessor classes need to be instantiated). So to make these resource available within the unit test project I simply made the Resources class public (by default it's internal). ...
You read it correctly...TypeMock is giving out free licenses... well not to everyone, but hey... you can try. I'm posting this in hopes I get some licenses that I can hand out to readers... and that would be all of you :) I'll let you know how it goes :) Unit Testing ASP.NET? ASP.NET unit testing has never been this easy. Typemock is launching a new product for ASP.NET developers – the ASP.NET Bundle - and for the launch will be giving out FREE licenses to bloggers and their readers. The ASP.NET ...