@@ -291,3 +291,43 @@ TEST(ArgumentsCase, ScalarArgumentString)
291
291
ASSERT_EQ (response::Type::String, actual.type ()) << " should parse the object" ;
292
292
ASSERT_EQ (" foobar" , actual.get <response::StringType>()) << " should match the value" ;
293
293
}
294
+
295
+ TEST (ArgumentsCase, FindArgumentNoTemplateArguments)
296
+ {
297
+ response::Value response (response::Type::Map);
298
+ response.emplace_back (" scalar" , response::Value (" foobar" ));
299
+ std::pair<response::Value, bool > actual { {}, false };
300
+
301
+ try
302
+ {
303
+ actual = service::ModifiedArgument<response::Value>::find (" scalar" , response);
304
+ }
305
+ catch (service::schema_exception& ex)
306
+ {
307
+ FAIL () << response::toJSON (ex.getErrors ());
308
+ }
309
+
310
+ ASSERT_TRUE (actual.second ) << " should find the argument" ;
311
+ ASSERT_EQ (response::Type::String, actual.first .type ()) << " should parse the object" ;
312
+ ASSERT_EQ (" foobar" , actual.first .get <response::StringType>()) << " should match the value" ;
313
+ }
314
+
315
+ TEST (ArgumentsCase, FindArgumentEmptyTemplateArgs)
316
+ {
317
+ response::Value response (response::Type::Map);
318
+ response.emplace_back (" scalar" , response::Value (" foobar" ));
319
+ std::pair<response::Value, bool > actual { {}, false };
320
+
321
+ try
322
+ {
323
+ actual = service::ModifiedArgument<response::Value>::find<>(" scalar" , response);
324
+ }
325
+ catch (service::schema_exception& ex)
326
+ {
327
+ FAIL () << response::toJSON (ex.getErrors ());
328
+ }
329
+
330
+ ASSERT_TRUE (actual.second ) << " should find the argument" ;
331
+ ASSERT_EQ (response::Type::String, actual.first .type ()) << " should parse the object" ;
332
+ ASSERT_EQ (" foobar" , actual.first .get <response::StringType>()) << " should match the value" ;
333
+ }
0 commit comments