Tag | Unit Testing Posts

I was recently given an opportunity to review the TypeMock Isolator v7 framework. This is a very feature rich add-in for Visual Studio which simplifies unit testing by putting all the features you need right at your finger tips. Below is an abbreviated list of features found in the product. Components AutoRunner Failed Test Analyzer Coverage Test Auto-Complete The biggest productivity feature is the unit testing dashboard which drops down from the top of your Visual Studio code window. It provides ...
One of the earliest lessons I was taught in Enterprise development was "always program against an interface". This was back in the VB6 days and I quickly learned that no code would be allowed to move to the QA server unless my business objects and data access objects each are defined as an interface and have a matching implementation class. Why? "It's more reusable" was one answer. "It doesn't tie you to a specific implementation" a slightly more knowing answer. And let's not forget the discussion ...
Testing for ModelState.IsValid when unit testing your controller is not straightforward, since the Model Binding is responsible for validating you model. But Model Binding happens in OnActionExecuted filter (and NOT when you call your controller Action method). That means in your test context, Model Binding will not happen when you call your action method and ModelState.IsValid will always be true. But thanksfully, there is a solution below If we have the following simplistic model : public class ...
If you're like me and are using MVVMLight to build Windows Phone apps, you probably want to unit test your ViewModels as well. One of the benefits of the MVVM pattern is the separation of concerns between the View (page holding the xaml layout and bindings) and the ViewModel which holds the data to be bound. This allows the ViewModel to be easily testable, or so they say. In the end, it is quite difficult to find some useable tutorial doing exactly that. To the point you might ask yourself : " do ...
I'm a big believer in the benefits of having automated tests live with your code. I'm not an aspirant to Red-Green-Refactor Nirvana, but I believe there is a huge value to be gained by taking the code from Button1_Click in the only Windows Form application you've ever written and placing it instead into a method that can be used by a unit test framework. Some of the benefits that I glean from this include my test being preserved past the initial implementation (when you write the next feature of ...
Article Source: http://geekswithblogs.net/c... TODO's in code should only be used for a short period of time to remind you that something needs to be done. They should be addressed as soon as possible. In order to know who owns a TODO task and how long it’s been outstanding, my company uses the following formatting standard: Format: // TODO : Owner Initials – Date Created – Description of task. Sample: // TODO : CM – 2011\11\22 – Move this class to a reusable location. Using this pattern makes ...
Now that we have shown the EDMX with XPO/XAF and how use SpecFlow and BDD to run EasyTest scripts, let’s put it all together and show the evolution of a project using all the tools combined. I have a simple project that I use to track my priorities throughout the day. It uses some of Stephen Covey’s principles from The 7 Habits of Highly Effective People. The idea is to write down all your priorities the night before and rank them. This way when you get started tomorrow you will have your list of ...
This is the third of a three part series that deals with the issue of faking test data in the context of a legacy app that was built with Microsoft's Entity Framework (EF) on top of an MS SQL Server database – a scenario that can be found very often. Please read the first part for a description of the sample application, a discussion of some general aspects of unit testing in a database context, and of some more specific aspects of the here discussed EF/MSSQL combination. Lately, I wondered how you ...
So in my previous posts I showed you how I used EDMX to quickly build my business objects within XPO and XAF. But how do you test whether your business objects are actually doing what you want and verify that your business logic is correct? Well I was reading my monthly MSDN magazine last last year and came across an article about using SpecFlow and WatiN to build BDD tests. So why not use these same techniques to write SpecFlow style scripts and have them generate EasyTest scripts for use with XAF. ...
This is the second of a three part series that deals with the issue of faking test data in the context of a legacy app that was built with Microsoft's Entity Framework (EF) on top of an MS SQL Server database – a scenario that can be found very often. Please read the first part for a description of the sample application, a discussion of some general aspects of unit testing in a database context, and of some more specific aspects of the here discussed EF/MSSQL combination. Lately, I wondered how ...
I've wrote this article a few months ago but in Portuguese: http://pontonetpt.org/blogs... I've decided to translate it to engish. The sample project is hostead at GitHub but it's in Portuguese (the same as my first article). Link Github: https://github.com/guilherm... I've been progamming with unit testing and test-driven developement in use for server-side for 2 years. On the last months i've been working ...
Test Data Builder Pattern When unit testing we often need to fill any POCO objects with enough data to satisfy the needs of the test. Redoing this in every test can quickly become a burden and slow down the testing process. Test Data Builder is a pattern that’s meant to help in just that situation. With test data builder you build a fluent interface that allows you to build out your POCO objects by only replacing the properties that you need specific values for. The other values are set to defaults ...

In the developer preview of Windows 8, I just noticed a breaking change in the way that data bindings react to the PropertyChanged event.

Read the rest of this entry »

Yeah, you read that right. I may be weird, but I do think that unit testing is fun. It is also very important. I didn’t know much about Unit testing when I came out of school. I think colleges need to have a class dedicated to it. But anyway, I didn’t do much of it at my previous job since I was developing the Siebel CRM. Since Siebel is an Oracle product, it involves mostly configuration and customization using built components. We did some integration testing by building any new components into ...
Check out the Top Five most popular news at SilverlightShow for SilverlightShow Top 5 News for August 14 - 21, 2011. Here are the top 5 news on SilverlightShow for last week: The Top 5 WPF and Silverlight Gotchas Can Microsoft ‘fix’ JavaScript and make HTML5 applications viable? The LOB Chronicles - Exploring User Experience (UX) Slides for our upcoming 'Deep-DIVE in Silverlight FIVE' webinar Mango Baby Steps: Unit Testing your WP7 app Visit and bookmark SilverlightShow. Stay in the 'Light ...
When testing in ASP.NET MVC3, one of the common elements you might want to test is authorization. Although the framework does most of the heavy lifting for ASP.NET Membership and authorization it is still worthwhile to be able to write a test to show that the proper Authorization tag is in place. You might think that it’s as easy as calling the method on the controller with a proper context, but that’s not the case. When you call the methods directly on the controller the authorizations are skipped. ...
Getting the ressources First at all download xUnit http://xunit.codeplex.com/r... xUnit Contrib ReSharper http://xunitcontrib.codeple... This gives you a bridge between ReSharper functionality and your XUnit coding. Installation und Configuration Unzip both archives. xUnit part Configure the code to use xUnit Normally I prefer a single checkout point for my developing solution – this whole bundle I name DevTree. One of the top folders in the hierarchy of this DevTree is a lib-Folder. ...
In this Issue: Michael Washington, Teppo Kotirinta, Loek van den Ouweland, Daniel Vaughan, Adam Kinney, Peter Torr, Morten Nielsen, John Garland, Jaime Rodriguez(-2-), Jesse Liberty(-2-), and Xpert360. Above the Fold: Silverlight: "Debugging Data Bindings in XAML with Silverlight 4" Xpert360 WP7: "Windows Phone 7 for Designers — Cheat Sheet" Teppo Kotirinta LightSwitch: "LightSwitch Concurrency Checking" Michael Washington Shoutouts: Timmy Kokke gave a presentation at DevDays in the Netherlands and ...
Recently while performing a .Net unit testing on some .Net dll, I kept getting the below error - 'XXX is a strongly named assembly. It will need to be re-signed before it can be executed. Warning VSP2013 : Instrumenting this image requires it to run as a 32-bit process"...... A little of google revealed that since its a strongly named assembly and while performing unit testing it needed to be re-signed or I need to remove the 'strong name' all together... As I didn't had the orginal private key file ...
Doing more unit testing and I ran across this nice article on mocking up TempData. That’s great because tempdata is used a lot in controllers and you need a way to mock it for unit testing. Again, this code is in C#, so I will show you the vb version. http://weblogs.asp.net/left... Hres the StubTempDataHttpSessionState class: Imports System.Web.Mvc Imports System.Web ''' <summary> ''' HttpSessionState for TempData ...
I was working on unit testing today for an MVC application and needed to mock up the http context for an action method. I found this article that shows how to do this nicely. http://bradwilson.typepad.c... Yeah, I know, you can do this with rhino mock and others. But this works too. I converted this to VB so I could use it in the same project. Heres the vb code: Imports System.Collections.Specialized Imports System.Web Public Class ...
The worst part about web application development is the phase in the unit testing where we developers swear we've fixed something, but still when we test the change, the fix isn't there. After awhile, we remember to clear the browser cache and we discover the fix worked! In some cases, we really haven't fixed what we thought we fixed--and in other cases, we haven't really cleared the cache. I was working in FireFox recently and realized I hadn't really cleared the cache when I added a new button ...
Quick announcement: I just had the extreme pleasure to talk at the UK TechDays online conference (organized over LiveMeeting) and had about 100 persons in the session, thanks to all for allowing me to talk to you about MVVM! I just pushed the whole sample code as well as the slides to a SkyDrive folder, so feel free to download and experiment. Read the rest of this entry » ...
An important part of Agile is the concept of transparency and visibility. In proper functioning teams, stakeholders can look at any team at any time in the iteration or release and see how that team is doing by simply looking at what we call Big Visible Charts. If you’ve done Scrum, you’ve seen these charts. However, interpreting these charts can often be an art form. There are several different charts that can be useful. In this newsletter, I’ll focus on the Iteration Burndown and Cumulative Flow ...
Visual Studio 2010 Service Pack 1 (SP1) is now available for general download for almost a week now. The Beta of SP1 came couple of months back and it did a lot of performance enhancements, added support for HTML5 tags and few other stuff related to web development. Now, the final release of SP1 is available. The good part is that, if you had installed the SP1 beta, you don’t have to remove the Beta and start all over again. You can apply the final release on top of the Beta and it works like a charm. ...
In this Issue: András Velvárt, WIndowsPhoneGeek(-2-), Jesse Liberty(-2-), Victor Gaudioso, Kunal Chowdhury, Jeremy Likness, Michael Crump, and Dhananjay Kumar. Above the Fold: Silverlight: "Application Library Caching in Silverlight 4" Kunal Chowdhury WP7: "Handling WP7 orientation changes via Visual States" András Velvárt Shoutouts: Joe McBride gave a MEF Head User Group presentation and has posted How to Become a MEF Head – Slides & Code From SilverlightCream.com: Handling WP7 orientation changes ...
As a post VS2010 SP1 installation activity, I am recompiling all my open source projects. The first is XHTMLFIX at http://xhtmlfix.codeplex.com/ This LGPL project has simple fixes to ASP.NET 2.0/4.0 to achieve XHTML compliance as measured by the W3C tests at http://validator.w3.org/ The XHTML project shows as untrue the commonly held belief that MVP or MVC are necessary for producing XHTML compliant web pages. Incidentally the other supposed advantage of MVP and MVC over web forms of easier testing ...
In this Issue: Ian T. Lackey, Peter Kuhn, WindowsPhoneGeek(-2-), Jesse Liberty(-2-), Martin Krüger, John Papa, Jeremy Likness, Karl Shifflett, and Colin Eberhardt. Above the Fold: Silverlight: "Silverlight TV 65: 3D Graphics" John Papa WP7: "Developing a Windows Phone 7 Jump List Control" Colin Eberhardt Shoutouts: Telerik announced a special sale on their RadControls for WP7... check it out: RadControls for Windows Phone 7 - on Sale from March 16th at a Special Promo Price! From SilverlightCream.com: ...
I posted this yesterday but had the wrong link at the bottom. SP1 for VS 2010 just hit the web today. Check it out at http://support.microsoft.co... This should fix lots of big and little things such as startup time, bugs and more. Plus there are tons of features in there too for web, xaml, and other application types. I am really excited about the unit testing and load testing features that were added. Theres also an update for .Net 4 framework. And check out the new Silverlight ...
SP1 for VS 2010 just hit the web today. Check it out at http://support.microsoft.co... This should fix lots of big and little things such as startup time, bugs and more. Plus there are tons of features in there too for web, xaml, and other application types. I am really excited about the unit testing and load testing features that were added. Theres also an update for .Net 4 framework. And check out the new Silverlight performance wizard. Lots of really cool stuff. Get it today! ...
Normal 0 false false false EN-ZA X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans... ...
Applications get data from lots of different sources. The most common is to get data from a database or a web service. Typically, we encapsulate calls to a database in a Repository object and we create some sort of IRepository interface as an abstraction to decouple between layers and enable easier unit testing by leveraging faking and mocking. This works great for database interaction. However, when consuming a RESTful web service, this is is not always the best approach. The WCF Web APIs that are ...
I've decide to write about unit testing in the next weeks. If we decide to develop with Test-Driven Developement pattern, it's important to not forget the routes. This article shows how to test routes. I'm importing my routes from my RegisterRoutes method from the Global.asax of Project.Web created by default (in SetUp). I'm using ShouldMapTp() from MvcContrib: http://mvccontrib.codeplex.... The controller is specified in the ShouldMapTo() signature, and we use lambda expressions for the action ...
Developers that use unit testing are familiar with Resharper and his plugin for Unit Testing. For those that like me, don't have a great pc hardware (Pentium 4, 3ghz, 1GB ram) the Resharper can be really slow, and affect the performance of pc. That's why i use TestDriven.NET TestDriven.NET is a freeware license tool (there are others licenses for this product) that gives us the possibility to run unit tests with this plugin, that's integrated with Visual Studio. You can check some screenshots here: ...
There is a bug in the unit testing framework in Visual Studio 2010 with unit testing. The bug appears in a very special circumstance involving an internal generic type. The bug causes the following exception to be thrown: System.InvalidProgramExcept... JIT Compiler encountered an internal limitation. This occurs under the following circumstances: Type being tested is internal or private Method being tested is generic Method being tested has an out parameter Type accessor functionality used to access ...
I still haven't updated my friends at SilverlightShow, but I have their list from last week. Check out the Top Five most popular news at SilverlightShow for last week (13 - 19 Dec 2010). First place for the past week takes the post about Mahesh Sabnis' sample Line-Of-Business app using Silverlight 4. A lot of clicks and downloads got also the recording of SilverlightShow webinar 'Building an end-to-end Silverlight 4 Application' presented by Gill Cleeren on Dec 15th. Here is SilverlightShow's weekly ...
In this Issue: Rénald Nollet, Benjamin Gavin, Dennis Doomen, Tim Greenfield, Mike Taulty, Jeff Blankenburg, Michael Crump, Laurent Duveau, Dragos Manolescu, KeyboardP, Yochay Kiriaty. Above the Fold: Silverlight: "Silverlight RIA Services and Basic, Anonymous Authentication" Benjamin Gavin WP7: "lving Circular Navigation in Windows Phone Silverlight Applications" Yochay Kiriaty SQL Azure: "SQL Azure Database Manager – Part 1 : How to connect to your SQL Azure DB" Rénald Nollet Shoutouts: Yochay Kiriaty ...
Is unit testing a difficult thing to ask for? I don't understand why developers try to simply avoid unit testing. We have unit testing integrated to Visual Studio; there is also NUnit. These make life easier, not difficult. Maybe, it needs a little getting used to at first; but eventual benefit simply outweighs all the pains. I have noticed that people try to build unit tests if they are carefully watched; otherwise they tend to skip. It is sometimes difficult to implement strict procedures in a ...
Scrum is an agile framework that deliver an iterative and incremental management approach for software development. In the same way than Extreme Programming (XP), Feature Driven Development (FDD), and Crystal, Scrum provides an “Agile Approach” to build software using a set of practices that includes different artifacts such as Product Backlogs and Sprint Backlogs, “time-boxes” such as Sprint, Daily Meeting and predefined roles for the members of the Team (Team == all direct participants into the ...
Any ramblings and blog posts associated with the UNISA ICT 2622 tag should be considered study notes for my lectures… Objectives of Chapter 16 Describe implementation and support activities Choose an appropriate approach to program development Describe various types of software tests and explain how and why each is used List various approaches to data conversion and system installation and describe the advantages and disadvantages of each Describe different types of documentation and the processes ...
In this Issue: Viktor Larsson, Roger Peters, Kirupa Chinnathambi, Kyle McClellan, Jag Reehal, Dinesh Sodani, David Rousset, Jeff Fansler, Paul Sheriff, Jeremy Likness, Mohamed Mosallem, and Jonathan van de Veen. Shoutout: The Visual Web Developer Team Blog posted Hot Fix Released for the Issue of Visual Studio 2010 Crashing When Switching to the Design View From SilverlightCream.com: Snipping databound properties Viktor Larsson has discussion of code snippets up in his latest post. He's specifically ...
In this Issue: Michael Washington, Ezequiel Jadib, Kunal Chowdhury, Ernesto Herrera, Levente Mihály, Rob Davis, Sergey Barskiy, Jeremy Likness, Victor Gaudioso, and Jonathan van de Veen. Shoutout: Right on cue, Erik Mork and company posted This Week In Silverlight 7.23.2010 – Early Windows Phone 7 Reviews From SilverlightCream.com: Using The Silverlight DataGrid with View Model / MVVM Michael Washington has posted a tutorial on a pretty-much all-singing, all-dancing DataGrid (i.e. inline edits, button ...
In this Issue: Kirupa Chinnathambi, Sergey Barskiy, Jesse Liberty(-2-), Shawn Wildermuth, Djonatas Tenfen, Yochay Kiriaty(-2-), Jason Zander. Shoutouts: Jeremy Likness follows up his Silverlight Profiling post with this one: Silverlight Profiling Part 2: The Easy Way Jeremy Likness also announced a release: Sterling OODB v0.1 Alpha Released! The Silverlight Team Blog announced Ooyala and Silverlight Bring the Beach Volleyball Open to You, Live! From SilverlightCream.com: Optimizing the On-Screen ...
Unit test suites are often used as a quality tool during the development process to keep the codebase stable as it changes and expands. Tools such as NUnit, MSTest are often used to run and report on the test suites. However, when implementing unit testing in your build process, you have no way of knowing how much of your code the unit tests are actually testing. This is where code coverage comes in. You can run NUnit, MSTest within the Code Coverage tool and use the report to determine which code ...
I recently had the privilege of taking part of a conversation about available blog engines with some of our Microsoft Community Leaders. I since got interested in finding out more about available .Net-based extensible blogging engines. Two days ago, I came across a link about Oxite, a codeplex ASP.Net MVC-based mature open source blogging engine (http://oxite.codeplex.com). While the Oxite project is no longer active, its source remains available and downloadable. Additionally, the future holds great ...
We software engineers and architects sometimes feel like the rope in a tug-of-war. Pulling from one side is the short-term goal of delivering functionality, preferably yesterday. Indeed, our customers cannot justify paying for our services unless we deliver a working product, better and faster than our competitors. Pulling from the other side, however, is the long-term goal of quality. If our code becomes too disorganized or hard to understand, we cannot long remain in business, because we will no ...
Today I released an open source project for doing xUnit style unit testing. Recently I got roped into doing some embedded C code for a project and I wanted to TDD it. On investigating my unit testing framework options I ended up rolling my own as many frameworks were either too simple or trying to be too smart. While I’m generally happy with the general style of how to write tests with it, there’s a number of things to cleanup and it probably needs a bit more rounding out for other peoples needs. ...
Our April meeting was presented by Wilson Kutegeka on the topic of Building the Data Access a layer. In his presentation he showed a tool which he has developed to generate the entities, stores procedures that would be used to reduce having to retype the same boilerplate code for each entity. He uses visual basic samples to demonstrate access to the data from the database and inherits his classes from an abstract class which contains common properties including connection strings, save and delete ...
I was working through some scenarios recently with Azure and Silverlight. I immediately decided a quick walk through for setting up a Silverlight Application running in an ASP.NET MVC 2 Application would be a cool project. This walk through I have Visual Studio 2010, Silverlight 4, and the Azure SDK all installed. If you need to download any of those go get em? now. Launch Visual Studio 2010 and start a new project. Click on the section for cloud templates as shown below. After you name the project, ...
In this Issue: Michael Washington, Jason Young(-2-, -3-), Phil Middlemiss, Jeremy Likness, Victor Gaudioso, Kunal Chowdhury, Antoni Dol, and Jacek Ciereszko(-2-). Shoutout: Victor Gaudioso has aggregated All of My Silverlight Video Tutorials in One Place (revised again 05.02.10) From SilverlightCream.com: Unit Testing A Silverlight 'Simplified MVVM' Modal Popup Michael Washington's latest 'Simplified MVVM' post is published at The Code Project and is on Unit Testing with MVVM. Input Localization ...