:: thoughts on team system and more RSS 2.0
# Thursday, February 15, 2007

Many people seem to have a hard time finding a good procedure to migrate unit test from nUnit to VSTS so I thought I'd post the way I'd make the conversion.

Jim Newkirk has created a conversion tool that's available at http://www.gotdotnet.com/workspaces/workspace.aspx?id=91936c5e-461f-4027-bdba-8a46f52fefdb.

Personally I prefer to do the conversion by hand (not a lot of work anyway). Here's also a step-by-step guide for manually converting nUnit tests to a VSTS unit test project:

1. Add a reference to Microsoft.VisualStudio.QualityTools.UnitTestFramework.

2. Remove reference to nunit.framework.

3. Change the following namespace imports:

C#: Change using NUnit.Framework declaratives to using Microsoft.VisualStudio.TestTools.UnitTesting
VB: Change Imports NUnit.Framework declaratives to Imports Microsoft.VisualStudio.TestTools.UnitTesting

4. Search and replace the following:

C#: [TestFixture] => [TestClass]
VB: <TestFixture()> => <TestClass()>

C#: [TestFixtureSetUp] => [ClassInitialize]
VB: <TestFixtureSetUp()> => <ClassInitialize()>

C#: [TestFixtureTearDown] => [ClassCleanup]
VB: <TestFixtureTearDown()> => <ClassCleanup()>

C#: [SetUp] => [TestInitialize]
VB: <SetUp()> => <TestInitialize()>

C#: [TearDown] => [TestCleanup]
VB: <TearDown()> => <TestCleanup()>

C#: [Test] => [TestMethod]
VB: <Test()> => <TestMethod()>

Assert.Ignore => Assert.Inconclusive

5. Open the Visual Studio project file in Xml (using Open As... in Visual Studio or use Notepad) and add the following to the msbuild script:

Paste the following line in the <PropertyGroup> that contains <AssemblyName> and other properties:

C#: <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
VB: <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>

Thursday, February 15, 2007 10:10:19 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
Team System
# Saturday, January 20, 2007

This week I found myself wanting to look at the raw XML data sent between a client and a service. Of course the WCF tool SvcTraceViewer generally makes more sense to use for tracing, but sometimes it's necessary to look at the actual data on the wire. In such case a tcp trace tool can be used and placed in-between the caller and the service. In the end this was really easy to setup but in order to save someone else the hour or so to figure it out here's how it works:

For tracing I used Simon Fell's tcpTrace available at http://www.pocketsoap.com/tcptrace/.

First start tcpTrace. It needs to sit in the middle of the call so have it listen to the port the server exposes and forward to different port. Then configure the server to listen to the port tcpTrace forwards to using the listenUri configuration setting. The client doesn't have to be changed since all it does is call tcpTrace, which then forwards to the service. The config used looks like this: 

Server config:

<service name="Service.Calculator">
   <
endpoint address="http://localhost:8001/CalculatorService"
                 listenUri="http://localhost:8002/CalculateService"
                 binding="basicHttpBinding"
                 contract="Service.ICalculator"         
   />
</
service>

Client config:

<client>
   <
endpoint address="http://localhost:8001/CalculatorService"
                 
binding="basicHttpBinding"
                 
contract="ICalculator"

   />
</
client>

Saturday, January 20, 2007 1:51:49 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [1] -
WCF (Indigo)
# Thursday, January 11, 2007

Note to self: Just to save the extra minutes to find the darn download - the VSTS Team Explorer can be downloaded here.

Thursday, January 11, 2007 9:21:10 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
Team System
# Friday, December 22, 2006

The new-and-improved version has been published. Promised this time is a number of buggfixes, especially VS2003 integration deserves this...

This version (1.2) includes (from the download page):

  • Enable handling branched solutions in Visual Studio 2003.
  • Fixed issues to enable provider to support Toad for SQL Server 2.0.
  • Enhanced the "Choose Folder in Team Foundation Server" dialog.
  • Fixed bug which prevented Properties Dialog from displaying local path.
  • Work Items Query list in the Checkin Dialog is loaded and saved on the disk.
  • "Get" operation performance improvements.
  • Defect fixes

The Visual Studio 2005 Team Foundation Server MSSCCI Provider v.1.2 can be downloaded here.

Friday, December 22, 2006 9:33:46 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
Team System

Got this question yesterday; can the ASP.NET session object be used to store state in a web service? The answer is yes, but the web service method must be marked with EnableSession = true.

Below is a small code snippet that shows how it's done:

[WebMethod(EnableSession = true)]
public string HelloWorld()
{   
   // Check if item in cache, else add it.
   if (HttpContext.Current.Session["stateItem"] == null)
   {
      HttpContext.Current.Session["stateItem"] = "some-item-to-store";
   }

   return (string)HttpContext.Current.Session["stateItem"];
}

Simple, but yet easy to forget...

Friday, December 22, 2006 8:36:30 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
Web Services
# Thursday, November 30, 2006

Last week I was interviewed by the Swedish Microsoft Partner program about my thoughts regarding the MCP program, why we focus on certification and what the value of it is. The article can be found here: http://www.microsoft.com/sverige/partner/callista_mcp.aspx (in Swedish).

Thursday, November 30, 2006 6:35:42 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
General
News
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2009
Mathias Olausson
Sign In
Statistics
Total Posts: 77
This Year: 1
This Month: 1
This Week: 0
Comments: 31
All Content © 2009, Mathias Olausson
DasBlog theme 'Business' created by Christoph De Baene (delarou)