Skip to content

Instantly share code, notes, and snippets.

Created March 21, 2013 21:05
Show Gist options
  • Save anonymous/5216727 to your computer and use it in GitHub Desktop.
Save anonymous/5216727 to your computer and use it in GitHub Desktop.
test for ServiceStack UrlExtensions using Route with multiple parameters.
[Route("/route/{Id}/{Status}")]
public class JustIdAndStatus : IReturn {
public long Id { get; set; }
public long Status { get; set; }
}
[Theory]
public void Can_create_url_with_JustIdAndStatus([Values(0, 1, 2)] long id, [Values(0, 1, 2)] long status) {
var url = new JustIdAndStatus {
Id = id,
Status = status
}.ToUrl("GET");
Assert.That(url, Is.EqualTo(string.Format("/route/{0}/{1}", id, status)));
}
@grexican
Copy link

As I posted in the servicestack support channel:

Rudy are you finding that when Id is 0 and Status is 0 that they don't go through? If so, see: https://github.com/ServiceStack/ServiceStack/issues/537

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment