Created
July 21, 2012 12:57
-
-
Save chrissie1/3155764 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using EasyHttp.Infrastructure; | |
using Machine.Specifications; | |
namespace EasyHttp.Specs.Specs | |
{ | |
public class When_baseuri_is_null_and_query_is_null | |
{ | |
Establish context = () => | |
{ | |
uriComposer = new UriComposer(); | |
}; | |
Because of = () => url = uriComposer.Compose(null, null, "uri"); | |
It should_return_the_uri = () => url.ShouldEqual("uri"); | |
static UriComposer uriComposer; | |
static string url; | |
} | |
public class When_baseuri_is_empty_and_query_is_null | |
{ | |
Establish context = () => | |
{ | |
uriComposer = new UriComposer(); | |
}; | |
Because of = () => url = uriComposer.Compose(null, "", "uri"); | |
It should_return_the_uri = () => url.ShouldEqual("uri"); | |
static UriComposer uriComposer; | |
static string url; | |
} | |
public class When_baseuri_is_filled_and_does_not_end_with_a_forwardslash_and_query_is_null | |
{ | |
Establish context = () => | |
{ | |
uriComposer = new UriComposer(); | |
}; | |
Because of = () => url = uriComposer.Compose(null, "baseuri", "uri"); | |
It should_return_the_baseuri_plus_uri = () => url.ShouldEqual("baseuri/uri"); | |
static UriComposer uriComposer; | |
static string url; | |
} | |
public class When_baseuri_is_filled_and_ends_with_a_forwardslash_and_query_is_null | |
{ | |
Establish context = () => | |
{ | |
uriComposer = new UriComposer(); | |
}; | |
Because of = () => url = uriComposer.Compose(null, "baseuri/", "uri"); | |
It should_return_the_baseuri_plus_uri = () => url.ShouldEqual("baseuri/uri"); | |
static UriComposer uriComposer; | |
static string url; | |
} | |
public class When_baseuri_is_filled_and_ends_with_a_forwardslash_and_uri_starartswith_a_forwardslash_and_query_is_null | |
{ | |
Establish context = () => | |
{ | |
uriComposer = new UriComposer(); | |
}; | |
Because of = () => url = uriComposer.Compose(null, "baseuri/", "/uri"); | |
It should_return_the_baseuri_plus_uri = () => url.ShouldEqual("baseuri/uri"); | |
static UriComposer uriComposer; | |
static string url; | |
} | |
public class When_baseuri_is_filled_and_does_not_end_with_a_forwardslash_and_uri_starartswith_a_forwardslash_and_query_is_null | |
{ | |
Establish context = () => | |
{ | |
uriComposer = new UriComposer(); | |
}; | |
Because of = () => url = uriComposer.Compose(null, "baseuri", "/uri"); | |
It should_return_the_baseuri_plus_uri = () => url.ShouldEqual("baseuri/uri"); | |
static UriComposer uriComposer; | |
static string url; | |
} | |
public class When_baseuri_and_ur_are_filled_and_query_is_not_null | |
{ | |
Establish context = () => | |
{ | |
uriComposer = new UriComposer(); | |
}; | |
Because of = () => url = uriComposer.Compose(new {Name = "test"}, "baseuri/", "/uri"); | |
It should_return_the_baseuri_plus_uri = () => url.ShouldEqual("baseuri/uri?Name=test"); | |
static UriComposer uriComposer; | |
static string url; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment