YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IChatBotTest.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023-2023 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef ICHATBOTTEST_H
7#define ICHATBOTTEST_H
8
9#include <yarp/dev/IChatBot.h>
10#include <catch2/catch_amalgamated.hpp>
11
12using namespace yarp::dev;
13
14namespace yarp::dev::tests {
16{
17 REQUIRE(ichatbot != nullptr);
18
19 bool b;
20
21 b = ichatbot->setLanguage("eng");
22 CHECK(b);
23
24 std::string tempLang;
25 b = ichatbot->getLanguage(tempLang);
26 CHECK(b);
27 CHECK(tempLang == std::string("eng"));
28
29 b = ichatbot->resetBot();
30 CHECK(b);
31
32 std::string status;
33 b = ichatbot->getStatus(status);
34 CHECK(b);
35
36 std::string messageIn{"Hello!"};
37 std::string messageOut;
38 b = ichatbot->interact(messageIn,messageOut);
39 CHECK(b);
40}
41}
42
43#endif //ICHATBOTTEST_H
IChatBot interface.
Definition IChatBot.h:26
virtual yarp::dev::ReturnValue resetBot()=0
Resets the chatbot.
virtual yarp::dev::ReturnValue setLanguage(const std::string &language="auto")=0
Sets the chat bot language.
virtual yarp::dev::ReturnValue interact(const std::string &messageIn, std::string &messageOut)=0
Sends a message to the chatbot.
virtual yarp::dev::ReturnValue getLanguage(std::string &language)=0
Gets the current chatbot language.
virtual yarp::dev::ReturnValue getStatus(std::string &status)=0
Gets the current status of the bot.
void exec_iChatBot_test_1(yarp::dev::IChatBot *ichatbot)
For streams capable of holding different kinds of content, check what they actually have.