improve tests
This commit is contained in:
@@ -30,6 +30,11 @@ public:
|
||||
typedef std::string ParameterValueType;
|
||||
typedef std::map<ParameterNameType, ParameterValueType> ParameterCollection;
|
||||
|
||||
ServiceRequest(const std::string &product, const std::string &version);
|
||||
ServiceRequest(const ServiceRequest &other);
|
||||
ServiceRequest(ServiceRequest &&other);
|
||||
ServiceRequest &operator=(const ServiceRequest &other);
|
||||
ServiceRequest &operator=(ServiceRequest &&other);
|
||||
virtual ~ServiceRequest();
|
||||
|
||||
const char *content() const;
|
||||
@@ -54,12 +59,6 @@ public:
|
||||
void setBodyParameter(const ParameterNameType &name, const ParameterValueType &value);
|
||||
|
||||
protected:
|
||||
ServiceRequest(const std::string &product, const std::string &version);
|
||||
ServiceRequest(const ServiceRequest &other);
|
||||
ServiceRequest(ServiceRequest &&other);
|
||||
ServiceRequest &operator=(const ServiceRequest &other);
|
||||
ServiceRequest &operator=(ServiceRequest &&other);
|
||||
|
||||
void addParameter(const ParameterNameType &name,
|
||||
const ParameterValueType &value);
|
||||
ParameterValueType parameter(const ParameterNameType &name) const;
|
||||
|
||||
@@ -17,10 +17,12 @@ namespace {
|
||||
{}
|
||||
explicit TestServiceRequest(const ServiceRequest &other):
|
||||
ServiceRequest(other)
|
||||
{}
|
||||
{
|
||||
}
|
||||
explicit TestServiceRequest(ServiceRequest &&other):
|
||||
ServiceRequest(other)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
using ServiceRequest::addParameter;
|
||||
using ServiceRequest::coreParameter;
|
||||
@@ -103,4 +105,21 @@ namespace {
|
||||
EXPECT_TRUE(sr1.connectTimeout() == 1234);
|
||||
EXPECT_TRUE(sr1.readTimeout() == 22233);
|
||||
}
|
||||
|
||||
TEST(ServiceRequest, other){
|
||||
ServiceRequest one("one", "1.0");
|
||||
EXPECT_EQ("one", one.product());
|
||||
|
||||
ServiceRequest two("two", "1.0");
|
||||
EXPECT_EQ("two", two.product());
|
||||
|
||||
ServiceRequest three = one;
|
||||
EXPECT_EQ("one", three.product());
|
||||
|
||||
ServiceRequest four(two);
|
||||
EXPECT_EQ("two" , four.product());
|
||||
|
||||
ServiceRequest &&five(move(two));
|
||||
EXPECT_EQ("two" , five.product());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,9 +131,11 @@ TEST(LocationClient, callable)
|
||||
configuration.setConnectTimeout(100000);
|
||||
configuration.setReadTimeout(100000);
|
||||
Model::DescribeEndpointsRequest req;
|
||||
req.setMethod(HttpRequest::Method::Get);
|
||||
req.setId("cn-hangzhou");
|
||||
req.setServiceCode("ecs");
|
||||
req.setType("openAPI");
|
||||
req.setBodyParameter("foo", "var");
|
||||
|
||||
LocationClient client(key, secret, configuration);
|
||||
LocationClient::DescribeEndpointsOutcomeCallable cb = client.describeEndpointsCallable(req);
|
||||
|
||||
Reference in New Issue
Block a user