use github repo as central
This commit is contained in:
31
test/core/clientconfiguration_ut.cc
Normal file
31
test/core/clientconfiguration_ut.cc
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "alibabacloud/core/ClientConfiguration.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace AlibabaCloud;
|
||||
|
||||
|
||||
TEST(ClientConfiguration, basic) {
|
||||
const std::string regionId = "cn-shanghai";
|
||||
const std::string regionId_new = "cn-beijing";
|
||||
const std::string endpoint = "ep-cn-shanghai";
|
||||
|
||||
const std::string hostname = "hostname";
|
||||
const std::string user = "user";
|
||||
const std::string password = "password";
|
||||
uint16_t port = 12345;
|
||||
const NetworkProxy proxy(NetworkProxy::Http, hostname, port, user, password);
|
||||
|
||||
ClientConfiguration config(regionId);
|
||||
EXPECT_TRUE(config.regionId() == regionId);
|
||||
|
||||
config.setEndpoint(endpoint);
|
||||
config.setProxy(proxy);
|
||||
config.setRegionId(regionId_new);
|
||||
EXPECT_TRUE(config.endpoint() == endpoint);
|
||||
EXPECT_TRUE(config.regionId() == regionId_new);
|
||||
EXPECT_TRUE(config.proxy().hostName() == hostname);
|
||||
EXPECT_TRUE(config.proxy().port() == port);
|
||||
EXPECT_TRUE(config.proxy().user() == user);
|
||||
EXPECT_TRUE(config.proxy().password() == password);
|
||||
}
|
||||
Reference in New Issue
Block a user