本文整理汇总了C#中Server.GetBaseViewUri方法的典型用法代码示例。如果您正苦于以下问题:C# Server.GetBaseViewUri方法的具体用法?C# Server.GetBaseViewUri怎么用?C# Server.GetBaseViewUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server
的用法示例。
在下文中一共展示了Server.GetBaseViewUri方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: When_GetBaseViewUri_Is_Called_With_EncryptTraffic_True_Uri_Is_SSL_URI
public void When_GetBaseViewUri_Is_Called_With_EncryptTraffic_True_Uri_Is_SSL_URI()
{
var configuration = new ClientConfiguration
{
UseSsl = true
};
configuration.Initialize();
var json = File.ReadAllText(@"Data\\Configuration\\cb4-config-4-nodes.json");
var config = JsonConvert.DeserializeObject<BucketConfig>(json);
var nodes = config.GetNodes();
var node = nodes.Find(x => x.Hostname.Equals("192.168.109.104"));
var ioStrategy = new FakeIOStrategy(UriExtensions.GetEndPoint(node.Hostname + ":" + node.KeyValue),
new FakeConnectionPool(), false);
using (var server = new Server(ioStrategy,
node,
configuration,
config,
new FakeTranscoder()))
{
var uri = server.GetBaseViewUri("default");
Assert.AreEqual("https://192.168.109.104:18092/default", uri);
}
}
示例2: When_GetBaseViewUri_Is_Called_With_EncryptTraffic_True_Uri_Is_SSL_URI
public void When_GetBaseViewUri_Is_Called_With_EncryptTraffic_True_Uri_Is_SSL_URI()
{
var configuration = new ClientConfiguration
{
UseSsl = true
};
configuration.Initialize();
var connectionPool = new ConnectionPool<EapConnection>(new PoolConfiguration(), UriExtensions.GetEndPoint(Address));
var ioStrategy = new DefaultIOStrategy(connectionPool);
using (var server = new Server(ioStrategy, new Node(), configuration))
{
var uri = server.GetBaseViewUri("default");
Assert.AreEqual("https://localhost:18092/default", uri);
}
}
示例3: When_UseSsl_Is_True_Use_HTTP_Protocol
public void When_UseSsl_Is_True_Use_HTTP_Protocol()
{
var configuration = new ClientConfiguration
{
BucketConfigs = new Dictionary<string, BucketConfiguration>
{
{"beer-sample", new BucketConfiguration{BucketName = "beer-sample", UseSsl = true, Port = 18092}}
}
};
var json = File.ReadAllText(@"Data\\Configuration\\cb4-config-4-nodes.json");
var config = JsonConvert.DeserializeObject<BucketConfig>(json);
var nodes = config.GetNodes();
var node = nodes.Find(x => x.Hostname.Equals("192.168.109.104"));
var ioStrategy = new FakeIOStrategy(UriExtensions.GetEndPoint(node.Hostname + ":" + node.KeyValue),
new FakeConnectionPool(), false);
using (var server = new Server(ioStrategy,
node,
configuration,
config,
new FakeTranscoder()))
{
var uri = server.GetBaseViewUri("beer-sample");
Assert.AreEqual(uri, "https://192.168.109.104:18092/beer-sample");
}
}
示例4: Test_BuildUrl
public void Test_BuildUrl()
{
var configuration = new ClientConfiguration
{
BucketConfigs = new Dictionary<string, BucketConfiguration>
{
{"beer-sample", new BucketConfiguration{BucketName = "beer-sample", UseSsl = true, Port = 18092}}
}
};
var node = new Node
{
CouchApiBase = "http://192.168.56.104:8092/beer-sample%2Ba6f9e23c32a4fd07278459e40e91f90a"
};
using (var server = new Server(null, null, null, node, configuration))
{
var uri = server.GetBaseViewUri("beer-sample");
Assert.AreEqual(uri, "https://192.168.56.104:18092/beer-sample");
}
}