示例#1
0
 public void TestExpandsUriTemplatesNoQueryParams()
 {
     var template = "/foo{?bar,baz}";
     var link = new HalLink { Href = template };
     var client = new Ecom.Hal.HalClient(new Uri("http://example.com"));
     var parameters = new NameValueCollection();
     Assert.AreEqual("/foo", client.ResolveTemplate(link, parameters).ToString());
 }
示例#2
0
 public void TestExpandsUriTemplates()
 {
     var template = "/foo/{bar}/baz";
     var link = new HalLink {Href = template};
     var client = new Ecom.Hal.HalClient(new Uri("http://example.com"));
     var parameters = new NameValueCollection();
     parameters["bar"] = "bar1";
     Assert.AreEqual("/foo/bar1/baz", client.ResolveTemplate(link, parameters).ToString());
 }