Snippet for creating test method in VB.NET
September 7, 2010
I’ve already posted this snippet in C#, but as I from time to time need it in VB.NET I’ll post that too. Here you go:
<?xml version="1.0" encoding="utf-8" ?> <CodeSnippets xmlns="<http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>TestMethod</Title> <Shortcut>tm</Shortcut> <Description>Code snippet for creating a test method</Description> <Author>Marcusoft (www.marcusoft.net)</Author> <SnippetTypes> <SnippetType>Expansion</SnippetType> <SnippetType>SurroundsWith</SnippetType> </SnippetTypes> </Header> <Snippet> <Declarations> <Literal> <ID>methodName</ID> <ToolTip>The name of the test</ToolTip> <Default>methodName</Default> </Literal> </Declarations> <Code Language="VB"> <![CDATA[<TestMethod()> _ Public Sub should\_$methodName$() ' Arrange ' Act ' Assert Assert.Fail("Implement test!") ...
Virtual PC performance tip Multi-core support
September 6, 2010
I often get to work with brilliant people. That’s one of the real benefits of being a consultant, I would argue. Last week I got to know Thomas Gyllencreutz, who came onboard my project. He didn’t waste any time in getting the performance in our virtual development environments to new heights. This post is a condensation of his findings that really got our Virtual PC images flying.
A general performance tip is to put your virtual hard drive (.vhd-file) on a separate hard drive, as suggested by Mr. Hanselman.
OK, to get the multi-core support you’ll need to find out how many cores your system has. The easiest way to do that is to open Task Manager (CTRL+SHIFT+Esc) and check the number of CPU boxes under the performance tab:
This guide expects you to have an existing .VHD-file—the one with the...
A story on specification by example in two projects
August 22, 2010
The last month I’ve read The Goal by Elijah M. Goldratt. Apart from being a great book, it was also written in a really interesting way. It’s a novel in which we follow Mr. Alex Rogo and how he learns about the Theory of Constraints. I thought that I might try to mimic that style a bit in this post.
The subject I’m getting back to again and again nowadays is agile for the whole project. In my opinion, agile thoughts often come from development and never get a good foothold in the analysis/requirements or testing departments. “Yes, by all means… Do this agile you like so much, but please let us write the specs and test cases as we always have done.” – is a common reasoning where I’ve been.
OK – on to the story. It comes in two flavors, set in two different companies;...
Using BDD with SpecFlow, WPF and White
August 14, 2010
It’s been a while since I blogged. Twitter is taking over. I compensate that with a major blog post.
Background
I written about the project I’m in right now a couple of times before and to make a long story short; we don’t have any requirements! We only have the existing application which we are to “convert” from VB6 to VB.NET. 1:1 is the mantra – which is to be understood as: functional the same.
I have suggested for the team that we work with BDD (or ATDD if you like) to create the requirements as we go. They liked it. A lot!
To not let this post grow totally out of control, I leave the description for that process to another post.
To put my money where my mouth is and show them how it should be accomplished. This blog post is that description.
Solution to closing the lid of my MacBook cause it to get VERY hot
June 21, 2010
OK – this might not be one of my ordinary subjects but this was soo annoying. Sometimes when I closed the lid of my MacBook Pro there were something still running. This caused the battery to drain in about 20 minutes and the computer to go very, very hot. For the first time ever I actually burned myself on a computer.
I have checked around the net for a solution, and even went into a MacStore but as the error comes and goes there’s not much security in the tips.
As suspected one process doesn’t have time to close down and just keeps running. But which one?
In my case it was something called Safe Sleep (that prevents unsaved data from being lost if the power goes out). This is disabled by the following commands in a Terminal window:
sudo pmset -a hibernatemode 0...
Resolving policy enabled objects with Unity 2.0
June 14, 2010
I had the opportunity to use Unity and Enterprise Library in my current project. On of the really cool features of Enterprise Library (and most Dependency Injection frameworks) is the support for Aspect Oriented Programming. It’s a really neat way of handling the cross-cutting concerns in your application.
I was therefore very surprised when I had a really hard time to get, what I thought was simple, the following scenario to work:
I want the objects that I resolve to be “policy enabled” – i.e. configured in such a way that I can add policies in the configuration that can be picked up later and applied to the resolved objects.
That is, it was hard in Enterprise Library 4.1 and Unity 1.2. I had to scan the net and put together a solution of my own. It was a mix of extension...
Rewrite project - requirements SWAT team
June 7, 2010
In my current project we have had a problem. The project is a “rewrite” project that shall “convert” a VB6 application into a VB.NET version of it. I put those words in quotes for a reason; here-in lies much of our problem in my mind. From the business-side of the project this has been viewed as technical problem and project. It’s a 1:1 conversion (the word “re-compile” has been used at more than one occasion). We all know that this is not the case. And even if it was that simple and you actually could do a 1:1 conversion it’s a waste of time. But that’s another story. In any case, we have had problem to get the business to engage in our project. (When I say business here it refers to people with the knowledge and power to decide on what the system should do). And that’s not the...
TF203007 Cannot create the label because the version controlled item […] already exists or has been specified more than once
May 28, 2010
OK – I just broke my old “longest blog post title” but this was a problem we ran into today.
As I understand the message some kind of duplication has taken place, but I don’t know what to do about it. Well I found this on a msdn-forum:
This error is cause by one of your developer was deleted file and added exactly same file back in instead using undeleted feature, and in the backend database, TFS give this file new file id which has exactly same server path; therefore, when you are trying to label, it throws an exception which complaining file already existed. To work around this issue, you have to manually open label and remove […] Then you should be able to label again.
OK. One of those - “That’s strange, but it works”. Thank you Andy Pham.
Using ATDD in conversion project
May 26, 2010
I have been involved in a lot of conversion project. More specific it has been converting legacy VB6 applications to .NET applications. I’m not sure why or how but I have found myself in many project like this.
Common scenarios in conversion project
Very often these project has an ideal picture that “it’s just a conversion”. “This is 1 to 1 project” is a very common phrase in many of the projects I have been involved in. That can be understood as: “just convert it in the new language – with the exact same features”. I have even been asked to do bug conversion – that is to also convert any bugs I find into the new language.
Moreover, these project very often lack interest, time and effort from the stakeholders/customers/business people. To non-technical persons conversion is purely technical thing. “Just recompile it – let me know when you’re...
WCF, MVVM and good client design
May 11, 2010
Up to now most of my assignments has not been client-related. Often the project description and main focus is on the layers beneath the GUI. But lately I have seen a shift in the industry and more so in my own interest. Client-side stuff is coming on strong.
And it’s hard work to design a well structured client application. There are a lot of patterns but the frameworks and “recommended” ways up to now often doesn’t lend themselves well to those patterns. Ever tried to do proper MVC with WebForms or WinForms – it’s not easy.
But that has also shifted. I have written a lot on ASP.NET MVC – that of course supports the mother of all client patterns, MVC, in a great way. So enough said there.
But for “fat clients” such as windows clients there’s been a hazy mystery for me. I know...