Friday, February 18, 2011

Start SharePoint Application pool from command line

To do this, the following line needs to be run. Please note that it's important
1) don't have space between column and app pool'
s name
2) Quote the name of the application pool

%windir%\system32\inetsrv\appcmd start apppool /apppool.name:"SharePoint - 80"


Here are links that are related to this topic
Start or Stop an Application Pool (IIS 7)

iis7 - How do you start/stop IIS 7 app pool from cmd line if there are spaces in the app pool name? - Server Fault

Thursday, December 16, 2010

Remove all logs

Here is a script that deletes all logs in a specified directory. It's very short but still handy (I tend to recreate it over time)


SET INDIR=C:\Temp
del /S /Q %INDIR%\*.log
FOR /R %INDIR% %%I IN (Log,Logs) DO rd %%I /q /s

Wednesday, November 3, 2010

@ignore SpecFlow scenario

When you have all SpecFlow scenarios working, you always run them.
However, sometimes tests are incomplete or just broken. The correct course of actions is to fix or complete tests, but often you just don't have time (yeah, you need to deliver the product next day, but it will take two days to fix the test). In this case you may use a predefined tag, @ignore with SpecFlow scenarios. Adding this tag to a scenario will mark this test is ignored. That will allow you to pass tests without having ignored tests

For instance, you have a scenario which doesn't work yet

Scenario: Create User
Given ....


Running it as is causes a test (and the whole test suite) to fail





So once you modify as below


@ignore
Scenario: Create User
Given ....


You have your tests passed (or, more precisely, not failed).




P.S. Ignoring an issue is just a way to postpone its resolution, you'd need to fix to this scenario anyway. However, if this scenario isn't needed, just delete it.

Monday, August 2, 2010

Given-When-Then with SpecFlow

I think that key articles for understanding how BDD tests should be written are
Given-When-Then
and The Truth about BDD
I really recommend to read those articles if you're involved into any BDD testing (whether they use SpecFlow or not)

Thursday, July 8, 2010

SpecFlow scenario outlines

As many people know, SpecFlow is a tool that allows to write test scenarios in a human readable form and then run them using NUnit (other testing frameworks are also possible).

So, scenarios for SpecFlow typically look like below(I use Calculator as the simplest sample):


Scenario: TC1 Add two numbers
Given I have entered 1 into the calculator
And I have entered 2 into the calculator
When I press add
Then the result should be 3 on the screen

Scenario: TC2 Add two numbers
Given I have entered 2 into the calculator
And I have entered 2 into the calculator
When I press add
Then the result should be 4 on the screen


Obviously, In many cases number of scenarios for a single feature will be more that two, and those scenarios may differ only by values that are set as parameters.
And scenario outlines allow to define a scenario outline and then set a table of all parameters that should be passed to individual scenarios. Thus, the scenarios above may be transformed into:


Scenario Outline: TC5
Given I have entered <x> into the calculator
And I have entered <y> into the calculator
When I press add
Then the result should be <result> on the screen

Scenarios: addition
| x | y | result|
| 1 | 2 | 3|
| 2 | 2 | 4|

The scenario outline provides the same as individual scenarios (it will be the same number of tests with the same output). Moreover, when SpecFlow steps (which are defined in C#) are set for individual scenarios, they may work for Scenario outlines with no modifications. For instance, to make scenario outline above working , I didn’t write any line of code, I just changed the SpecFlow scenarios in the text editor. Using similar approach most sets of repetitive tests may be transformed to Scenario outlines at any time when it's needed.

More details on Scenario outlines are available at:
scenario outlines

Friday, July 2, 2010

Notepad++ to recognize custom file extensions

As many others, I am using Notepad++ as an editor to modify many XML files, which may have different extensions than XML. Such files may be configuration files for ASP.NET or MSBuild files. By default, when I opened them in Notepad++, I saw no syntax highlighting, everything was just black and white. In order to turn the highlighting on, I needed to explicitly select XML as a language each time when I opened such files.

However, using the following link, I just set extensions to what I needed.

http://www.mattblodgett.com/2007/11/notepad-tip-syntax-highlighting-for.html

So I have those files immediately recognize as XMLs when I open them

Thursday, April 22, 2010

SharePoint Server 2010 goes RTM

SharePoint Server 2010 RTM is available for MSDN subscribers at
MSDN subscription download area

Available to Levels: VS Pro with MSDN Premium (Empower); Developer AA; VS Premium with MSDN (MPN); VS Pro with MSDN Premium (MPN); MSDN Universal (VL); BizSpark Admin; BizSpark; VS Ultimate with MSDN (VL); VS Premium with MSDN (VL); VS Premium with MSDN (Retail); VS Ultimate with MSDN (Retail);

A Russian version of SharePoint Server 2010 is available at TechNet

Available to Levels: TechNet Plus SA Media; TechNet Plus (Retail); TechNet Direct (Retail); TechNet Plus (VL); TechNet Plus Direct (VL); TechNet Cert Partner; TechNet Gold Cert Partner; TechNet Plus Consumer Service Professional Pilot; TechNet Standard (VL); TechNet Standard (Retail);