Created
March 21, 2013 21:05
-
-
Save anonymous/5216727 to your computer and use it in GitHub Desktop.
test for ServiceStack UrlExtensions using Route with multiple parameters.
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
[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))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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