/* * Author: Patrick-Christopher Mattulat * Company: Lynar Studios * E-Mail: webmaster@lynarstudios.com * Created: 2023-04-07 * Changed: 2023-04-10 * * */ #include #include #include #include using ls::std::core::experimental::JniApi; using ls::std::core::experimental::JniClassParameter; using ls::std::core::experimental::interface_type::IJniApi; using std::make_shared; using std::shared_ptr; using test::core::jni::MockJniApi; using testing::Test; namespace { class JniClassParameterTest : public Test { public: JniClassParameterTest() = default; ~JniClassParameterTest() override = default; }; TEST_F(JniClassParameterTest, getJavaEnvironment) { JniClassParameter parameter{}; ASSERT_TRUE(parameter.getJavaEnvironment() == nullptr); } TEST_F(JniClassParameterTest, getJavaObject) { JniClassParameter parameter{}; ASSERT_TRUE(parameter.getJavaObject() == nullptr); } TEST_F(JniClassParameterTest, getJniApi) { JniClassParameter parameter{}; ASSERT_TRUE(parameter.getJniApi() == nullptr); } TEST_F(JniClassParameterTest, setJavaEnvironment) { JniClassParameter parameter{}; shared_ptr environment = make_shared(); parameter.setJavaEnvironment(environment.get()); ASSERT_TRUE(parameter.getJavaEnvironment() == environment.get()); } TEST_F(JniClassParameterTest, setJavaObject) { JniClassParameter parameter{}; shared_ptr<_jobject> javaObject = make_shared<_jobject>(); parameter.setJavaObject(javaObject.get()); ASSERT_TRUE(parameter.getJavaObject() == javaObject.get()); } TEST_F(JniClassParameterTest, setJniApi) { JniClassParameter parameter{}; shared_ptr jniApi = make_shared(); parameter.setJniApi(jniApi); ASSERT_TRUE(parameter.getJniApi() == jniApi); } }