Archives
-
How to mock extension methods
. without paying for a TypeMock Isolator license to do it ;-)
-
Resetting Visual Studio Experimental Instance to its super-clean initial state
If you are doing Visual Studio extensibility (VSX) work, you are probably aware of the existence of the Visual Studio "Experimental" instance. This is basically an instance of VS that has its own isolated registry, settings, extensions, etc. This allows you to test your extensions to VS without polluting your main development environment.
-
Clarius Visual T4 70% off!
-
Reactive Framework Extensions Generator
You probably know already that the Reactive Framework Extensions (Rx) is a new library on top of .NET 4.0 and Silverlight that allows developers to leverage the expressiveness and power of LINQ for .NET events. It brings an entirely new paradigm for doing event-driven apps, and therefore shines in WPF/Silverlight scenarios.
Read more about Rx at the team blog, the project home page and Matthew excelent blog series.
Even with the general availability of the bits for VS2010 beta2 at DevLabs, there's still quite a bit of work you need to do in order to leverage the extensions. Specifically, you need to turn your events into IObservables that can then use the Rx extensions for querying and subscribing. This is a lot of repetitive and boring code that can be easily automated. ...
-
The myth that TDD or test-first slows you down is true
I'm sad to say it, but it is true. It slows you down. But not everytime, and not for everything. So let's be more specific on the cases where it DOES slow you down noticeably:
-
Writing meaningful, self-documenting, behavior-oriented tests
Over the years I've come to realize that the one-fixture-per-class approach to unit testing just doesn't scale. As the amount of variations in state and interactions increases, that file starts becoming a big soup of "Should" methods that are increasingly difficult to traverse and find later on. Essentially, since every test is doing the first "A" in AAA (Arrange-Act-Assert) too, that means the context is also part of the test method.
-
Are you smart enough to do without TDD
Ayende wrote a controversial post titled
I'm so smart I don't need TDDEven tests has got to justify themselves ;-). It's important to read it, because it reinforces many of the reasons why "regular developers" (i.e. NOT *you* if you're even reading blogs as you are) continue to see "us" as some kind of unreachable and infallible elite of "hero programmers" who will eventually show up (i.e. be hired for big bucks, which we surely do want :)) and save the day.... -
How to always open the vsixmanifest in XML view
The new VSIX projects contain a manifest that is by default opened with a designer. No matter how many times you specify that you want to open it with the XML editor by default, VS will continue to open it with the designer.
-
Linq to Mocks is finally born
Last time I announced Linq to Mocks, some said Moq didn't actually have anything to do with Linq. Despite the heavy usage of lambda expressions and expression trees, the "q" in Linq is for "query" after all. And they were right, of course, but it was fun anyway, and the name is definitely cool IMO :).
-
Improved type safety when dealing with generic types, generic methods and reflection
Compile-time safety is always important, as it reduces the chances that a refactoring can break existing code that compiles successfully. This benefit took me previously to the path of using expression trees to achieve strong-typed reflection.
-
Extensible Test Assertions With MSTest VSTS
If you have used more than one unit test framework (i.e. xUnit.NET, NUnit, MSTest/VSTS, etc.), chances are that you’ll miss features from one when using another.
-
You Don’t Own Your Kindle Content: Amazon Does
-
Why Embedded Silverlight Makes Sense
So Microsoft just shipped Silverlight 3.0. Outstanding achievement in its own right for a company that takes multi-year cycles for pretty much every product, if you ask me.
-
How to get wi-fi network connectivity using Hyper-V
- Create a new Local Network with Virtual Network Manager (name it Hyper-V, for example)
- In the VHD, run msconfig.exe, in the Boot tab, click the Advanced options button, and select the Detect HAL option.
- Reboot the VM, reinstall the integration services and reboot again. Now you should get the new network adapter detected.
- Use ICS on the wi-fi network and select the local network Hyper-V as the one to share the connection with.
- To allow VPN access, you need to open a port (GRE) in the windows firewall as explained in http://help.wugnet.com/vista/VPN-server-configured-Generic-Routing-Encapsulatio-ftopict116489.html
-
Live Mesh as an application platform
The potential
You surely read quite a bit about Live Mesh. Oran Dennison has number of very technical and insightful posts on various aspects of the underlying platform.
-
MAB ContainerModel / Funq: a transparent container
From the point of view of the user of the container, he doesn't have to do anything at all. He just creates classes as usual:
-
Mobile Application Blocks ContainerModel / Funq: an introduction
-
What would you like to see in Enterprise Library 5.0?
There are few groups within Microsoft that are as open and so quick to deliver as patterns & practices. When you give them feedback or request features, chances are you'll see them implemented within months, rather than years (if they get enough support of the rest of the community!).
-
Announcing the free ViewModel Tool
If you're doing any kind of WPF development, you probably read at least some of the links in this entry on WPF Patterns.
-
Crazy Linq: replacing multiple and nested foreach statements with a query
Objective of the method: determine whether the given EnvDTE code class contains the given GeneratedCodeAttribute:
-
A picture is worth a thousand words: is XML dying?
-
Approaching Behavior Driven Development (BDD) from a Test Driven Development (TDD) perspective
Over the years doing TDD, I'm getting increasingly concerned about the value my test fixtures are bringing to the table in terms of documenting features and expected behavior.
-
Making WCF services amenable to testing
You know that using WebOperationContext.Current is BAD for making your service implementation testable, don't you?
-
Moq 3.0 RTM!!!
I've just released the latest version of Moq :))))
-
Freeing up data and collaboration via the mesh
Last weekend, during the ALT.NET Seattle conference, I spoke for quite a while with Miguel de Icaza on the work we're doing with InSTEDD in the area of data synchronization. He was very excited, and wondered how come this wasn't more broadly known.
-
Leveraging ILMerge to simplify deployment and your users experience
ILMerge is one of those little-known gems that are an absolute must-have once you know how to apply them effectively to scenarios you didn't even think about.
-
Making extension methods amenable to mocking
The question of how to mock extension methods comes up frequently enough that I though I might give my opinion and solution to it (which does NOT include using TypeMock ;)).
-
How to install Intel WiFi Link 5300/5100 drivers for Windows 7 Beta
I just couldn't resist going for the brand new beta which is being praised quite a bit when I got my new Lenovo X200.
-
Tip: how to tell a regular method apart from property getter/setters and event add/remove
Rather than typical code like:
-
How to upgrade Atom 0.3 feeds on the fly with a custom XmlReader for use with WCF Syndication APIs
Even now that Atom 1.0 has been approved and official for some time, there's a feed every now and then that still uses Atom 0.3 (i.e. Google News! http://news.google.com/?ned=us&topic=w&output=atom).
-
Updated WLW Cross-Post plugin
Now that there's an official installer of Live Writer that works on x64, I updated my plugin that allows you to cross-post a blog entry to a second WLW account, optionally summarizing the entry and always linking back to the source blog. I summarized the reasons why you might need to do this as well as the feature set in How to cross post entries across blogs from Windows Live Writer.
-
Crazy Linq: render a method invocation and its arguments as a string
Note: this entry has moved.
-
Buenos Aires MSDN and TechNet Briefing 2009
From my friend Pablo:
-
Funq: screencast series on how to building a DI container using TDD
Over the past few days, I spent some time recording the experience of building a dependency injection container using test driven development. It was a cool experience for me, and I hope you find the screencasts useful.
-
Evolving an API without breaking clients via extension methods, ObsoleteAttribute and EditorBrowsableAttribute: Part II
Due to a bug in VS intellisense (go vote for it!), my otherwise nice approach to API evolution doesn't quite work as I expected. Basically, regardless of whether you flag your obsolete methods (extension methods created by moving the deprecated behavior into a new "Legacy.dll" assembly) with EditorBrowsableState.Never, they will still show up in intellisense. You typically don't want that, as it would confuse users of test projects that contain legacy tests about which methods should be used:
-
Evolving an API without breaking clients via extension methods, ObsoleteAttribute and EditorBrowsableAttribute
API evolution is tough and versioning is a complex enough issue that deserves not one but several posts. So I will only focus on one specific kind of evolution and backwards compatibility: Source Compatibility.