本文整理匯總了C#中Nancy.Request.BaseUri方法的典型用法代碼示例。如果您正苦於以下問題:C# Request.BaseUri方法的具體用法?C# Request.BaseUri怎麽用?C# Request.BaseUri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Nancy.Request
的用法示例。
在下文中一共展示了Request.BaseUri方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Base_uri_should_contain_restbuckson_net_if_host_is_not_provided
public void Base_uri_should_contain_restbuckson_net_if_host_is_not_provided()
{
var request = new Request("method", new Url {HostName = "", Path = "path"});
var baseUri = request.BaseUri();
Assert.That(baseUri, Is.StringContaining("http://restbuckson.net"));
}
示例2: Base_uri_should_contain_request_port_if_present
public void Base_uri_should_contain_request_port_if_present()
{
var request = new Request("method", new Url {HostName = "host", Port = 8000, Path = "path"});
var baseUri = request.BaseUri();
Assert.That(baseUri, Is.StringContaining("http://host:8000"));
}
示例3: Base_uri_should_contain_request_scheme
public void Base_uri_should_contain_request_scheme()
{
var request = new Request("method", "path", "scheme");
var baseUri = request.BaseUri();
Assert.That(baseUri, Is.StringStarting("scheme://"));
}
示例4: Base_uri_should_contain_request_base_path
public void Base_uri_should_contain_request_base_path()
{
var request = new Request("method", new Url {HostName = "host", Path = "path", BasePath = "/basePath"});
var baseUri = request.BaseUri();
Assert.That(baseUri, Is.StringContaining("http://host/basePath"));
}