Skip to content
msuarz edited this page Nov 3, 2010 · 5 revisions

The Scenario becomes a template. Generates a test per Example row. Any Arg which content matches an Example column will take the value from the table.

Scenario: Shortening a url
	Given the url will be shorten with "service"
	When making a "status update" containing urls
	Then the urls should be "shorten"

	Examples:
	| service | status update                    | shorten					  | 
	| u.nu    | http://www.twitter.com/zunzunapp | http://u.nu/4kea4          |
	| is.gd   | http://www.twitter.com/zunzunapp | http://is.gd/bCPL6         |
	| bit.ly  | http://www.twitter.com/zunzunapp | http://bit.ly/5y7pgg       |
	| tinyurl | http://www.twitter.com/zunzunapp | http://tinyurl.com/ya9wfr4 |
    [TestMethod]
    public void ShorteningAUrl1()
    {         
        Given_the_url_will_be_shorten_with("u.nu");        
        When_making_a__containing_urls("http://www.twitter.com/zunzunapp");        
        Then_the_urls_should_be("http://u.nu/4kea4");
    }

    ...
        
    [TestMethod]
    public void ShorteningAUrl4()
    {         
        Given_the_url_will_be_shorten_with("tinyurl");        
        When_making_a__containing_urls("http://www.twitter.com/zunzunapp");        
        Then_the_urls_should_be("http://tinyurl.com/ya9wfr4");
    }
    void Given_the_url_will_be_shorten_with(string Service)
    {
    ...
    }

    void When_making_a__containing_urls(string StatusUpdate)
    {
    ...
    }

    void Then_the_urls_should_be(string Url)
    {
    ...
    }
Clone this wiki locally