Friday, March 26, 2010

I am back with VSTS 2010

Read my article "Architecture Modeling: Necessity, Connectivity, and Simplicty" from The Archiecture Journal 23 - Modeling and Processes available at http://msdn.microsoft.com/en-us/architecture/ff476944.aspx

Tuesday, June 24, 2008

Requirements Management with Visual Studio Team System

Nice article on the subject ..... http://www.microsoft.com/downloads/details.aspx?FamilyId=EEF7BB41-C686-4C9F-990B-F78ACE01C191&displaylang=en

Thursday, June 19, 2008

Testing the health of your Team Foundation Server

Test the below URL to know the health of your TFS Server
http://<ServerName>:8080/services/v1.0/serverstatus.asmx?WSDL

Friday, May 2, 2008

Testing ASP.NET Event callback methods using VSTS

Unit Testing a ASP.NET Application is a complex activity because the execution of a ASP.NET page also depends on the lot of information from the "context". A test method of a asp.net code behind must contain the following additional attributes.

1. UrlToTest - As the name suggests, it will be the complete URL to be tested.
2. HostType - Value of this will be ASP.NET
3. AspNetDevelopmentServerHost - This attribute has 2 arguments.First the physical directory of the web app and second the application root name.

Once you do this, using the TextContext Object you can now access the Page and all the controls (using page.FindControl method) within the page with the help of RequestedPage property.

To invoke the eventhandler methods which usually are not public, one can use the following approach

PrivateObject priobj = new PrivateObject(TestContext.RequestedPage);
priobj.Invoke(eventhandler_method, args1, args2);

Thursday, April 24, 2008

Unit Testing private members of the class using VSTE for Testers

By default unit tests will not have access to private members of the class. However this can be done with the help of Reflection. VSTS has a class PrivateObject which can help you do this. This class does all the required plumbing and gives you a straight forward approach to deal with this problem.

Following are the steps to use the PrivateObject class.

1. Instantiate the PrivateObject class by providing the “typeof” class to be tested. The best place to do this is the TestInitialize method.
2. Now you can access the private field of the class using the GetField method on the PrivateObject instance.
3. Similarly you can test the private method of the class using the Invoke method of the PrivateObject. This can be best done in a separate test method.

In a similar way you can access the static-private members of your test class using the PrivateType class

Back-up of the Team Foundation Server Data

You can refer to the Microsoft guidelines at http://msdn2.microsoft.com/en-us/library/ms253070(vs.80).aspx for back-up steps of the team foundation server (TFS) data

Wednesday, April 16, 2008

How to apply SAME Code Analysis rules to different visual studio projects

Pretty Simple.
1. Using a text editor, open the project file (.csproj, .vbproj, etc) of the project whose rules are to copied into another project.
2. Copy the section <CodeAnalysisRules> .......... </CodeAnalysisRules> from that file.
3. Using a text editor, open the project file (.csproj, .vbproj, etc) of the project INTO whom the rules are to be copied.
4. Replace the <CodeAnalysisRules> .......... </CodeAnalysisRules> section of this file by the information copied from the earlier project.
5. In case you don't see a <CodeAnalysisRules> .......... </CodeAnalysisRules> section insert the copied stuff as the last element in the <PropertyGroup Condition=" '$(Configuration)$(Platform)' == 'ReleaseAnyCPU' "> element block.