-
Weird procedure to activate Windows 2008 from MSDN subscription
-
I kept getting a "Activation Error: Code 0x8007232b DNS Name does not exist" error whenever I tried to activate Windows 2008 Standard (which has been running great on my X61 laptop so far as the host OS!).
Weird procedure you have to follow to activate:
Activate Windows Server 2008 RTM (MSDN Subscriber Downloads version)Read full article
-
Automocking container with Moq
-
I realized that I never blogged about this cool feature contributed by Slava to Moq-Contrib.
Auto-mocking containers was an idea originally (IIRC) from the guys at Eleutian, later on picked up by Jeremy Miller with Rhino Mocks and StructureMap.
The wiki document Slava put together on Automocking is a fantastic overview. Basically, you can have an (Autofac-powered) container create your objects under test with all its dependencies injected as mocks:...
Read full article
-
Where was the stubbing part in Moq?
-
In my very recent previous post I said "mocking and stubbing easier than ever", but actually forgot to mention the stubbing part :S.
This one is not new for users of moq-contrib, but we decided to move this to the core Moq library as we get the question on how to stub properties often enough... :)
It's actually rather simple and easy to implement just by using Moq external API, but as a facility, here's what you can do:...
Read full article
-
Mocking and stubbing easier than ever with Moq 2.6
-
I've just released a new version of Moq which contains a few bug fixes but two extremely useful features: recursive mocks and mocked default values.
Recursive mocks
Quite often you have a root mock object from which other mocks should "hang" through property accesses, such as HttpContextBase.Response: you want the response object returned to also be a mock.
Setting such hierarchies before this release was quite verbose:...
Read full article
-
What is all the fuzz about the new common IServiceLocator
-
There's been some excitement lately about the introduction of a common IServiceLocator that all major DI containers apparently will provide.
Unless you're building an "extensible framework leveraging framework consumer selectable IoC containers", don't sweat it too much, the interface was NOT created for you!
Let me reiterate: adding a dependency on IServiceLocator to your classes is NOT a good idea. When you do so, instead of an explicit and self documenting dependency on an external object, you're tunneling this locator that now hides to the class consumers which are its true dependencies. This is BAD, as it requires users to go to your class documentation (and hope it's updated) rather than its constructor to see what it needs to operate. If you've done any kind of work extending VS you know how bad this can get....
Read full article