Torbjörn Nomells blog  |
|
| Written by: Torbjörn Nomell | CQRS |
| 2012/09/06 |
| CQRS Journey on MSDN |
Guidance by Microsoft patterns & practices has been released and it looks promising. http://msdn.microsoft.com/en-us/library/jj554200
The foreword is written by Greg Young who is to consider a celebrity in the CQRS world, so it looks like Microsoft and the patterns & practices team did a great job. I'll have some busy nights in head of me to read this guidance. Another exiting project by Microsoft is the Service Bus (1.0 Beta, at the moment). http://www.microsoft.com/en-us/download/details.aspx?id=30376
Since CQRSarchitecture is gaining, the use of service buses will grow over the next yearsand it's great that Microsoft is in the game. |
 | 0 Comments |
| | Write new comment |  |
|
| Written by: Torbjörn Nomell | Web |
| 2012/08/13 |
| Lovely news in ASP.NET 4.5 |
Went to a seminar in June about the news in MVC4.
Well, some nice features were added to this release like bundling and minification but what I'm really been waiting for is:
Support for WebSockets Protocol! http://www.asp.net/vnext/overview/whitepapers/whats-new#_Toc318097383
Yes, it's true, ok we need IIS 8 but let's start build instant updating apps. When I was learning HTML 5 Web Sockets I down loaded a couple of web socket server console host implementations. But I could not publish anything to my web hotel because it only supports IIS. Also, customers I working for prefer IIS host applications.
Next problem, browser support... |
 | 0 Comments |
| | Write new comment |  |
|
 |
| Written by: Torbjörn Nomell | TDD |
| 2011/05/31 |
| Enhance unit tests by checking coverage |
When adding unit tests it can sometimes be hard to get an overview of how much code is covered, especially when adding tests to existing code. Why not try a code coverage tool? I tried PartCover, it's free and open source software. Here's how to use it with Nunit.
• Click File -> Run target • Edit settings

• Executable file: Full path to nunit-console.exe • Working directory: Path to NUnit directory • Working arguments: Path to test assemblies, delimited by spaces, DON’T forget /noshadow flag (to get source code from NUnit) • Rules: Specify Assemblies to test and Namespaces eg. +[Assembly]Namespace (Start with +[*]* to get everything) • Don't forget to save settings when satisfied • Start • Wait • Browse the resulting tree • Click Views -> View coverage details to see source code

.NET 4? Be aware! If your test assemblies are compiled for .NET 4 then things might not work. That’s because NUnit doesn't support .NET 4 by default(?). I had to add the following to nunit-console.exe.config <startup> <requiredRuntime version='v4.0.30319' /> </startup>
Coverage != Quality Just remember that good code coverage cannot be interpreted as good quality of unit tests and the aim of 100% coverage have several drawbacks. |
 |
 | 0 Comments |
| | Write new comment |  |
|
 |
| Written by: Torbjörn Nomell | TDD |
| 2011/05/27 |
| Test all C# enum values with NUnit |
I just tried to find a nice way to test all combinations of input parameters to a test case where one of the parameters is a C# enum. The thing is that I don't want to test the current range of enums but also those added in future. I found a blogpost about how to solve this with the TestCaseSource attribute. ValuesSource attribute could also be used if there are more input parameters to test. But the nicest way I could find out to do this was to extend NUnit with a new attribute.
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
public class EnumValuesAttribute : ParameterDataAttribute
{
protected System.Collections.ICollection data;
public EnumValuesAttribute(Type anEnum)
{
this.data = Enum.GetValues(anEnum);
}
public override System.Collections.IEnumerable GetData
(System.Reflection.ParameterInfo parameter)
{
return this.data;
}
}
Now our tests can look like this:
[Test]
public void Test(
[EnumValues(typeof(MyEnum))]MyEnum val,
[Values(true,false)]bool isNewUser)
{
}
|
 |
 | 0 Comments |
| | Write new comment |  |
|
| Written by: Torbjörn Nomell | .NET |
| 2011/05/25 |
| NServiceBus |
Had the opportunity to hear Udi Dahan and Andreas Öhlund talk about NServiceBus last week. To really understand what NServiceBus is all about I think I’ll have to download it and fiddle with it or maybe read some more blog posts. What I did understand that it’s a really cool architectural component that can simplify and enhance the systems we build. Not to mention sagas, which I have to dig in to a lot deeper. Udi is a good speaker and he can really captivate the audience. |
 | 0 Comments |
| | Write new comment |  |
|
|
 |
TalkActive Blog - Copyright 2008 - Talkactive ApS - all rights reserved.
|