1 /*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include <gtest/gtest.h>
17 #include "window_session_property.h"
18
19 using namespace testing;
20 using namespace testing::ext;
21
22 namespace OHOS {
23 namespace Rosen {
24
25 class WindowSessionPropertyTest : public testing::Test {
26 public:
27 static void SetUpTestCase();
28 static void TearDownTestCase();
29 };
30
SetUpTestCase()31 void WindowSessionPropertyTest::SetUpTestCase()
32 {
33 }
34
TearDownTestCase()35 void WindowSessionPropertyTest::TearDownTestCase()
36 {
37 }
38
39 namespace {
40 /**
41 * @tc.name: SetDragEnabled001
42 * @tc.desc: SetDragEnabled and GetDragEnabled to check the value
43 * @tc.type: FUNC
44 */
45 HWTEST_F(WindowSessionPropertyTest, SetDragEnabled001, Function | SmallTest | Level2)
46 {
47 WindowSessionProperty* property = new WindowSessionProperty();
48 ASSERT_EQ(property->GetDragEnabled(), true);
49 property->SetDragEnabled(false);
50 ASSERT_EQ(property->GetDragEnabled(), false);
51 }
52
53 /**
54 * @tc.name: SetRaiseEnabled001
55 * @tc.desc: SetRaiseEnabled and GetRaiseEnabled to check the value
56 * @tc.type: FUNC
57 */
58 HWTEST_F(WindowSessionPropertyTest, SetRaiseEnabled001, Function | SmallTest | Level2)
59 {
60 WindowSessionProperty* property = new WindowSessionProperty();
61 ASSERT_EQ(property->GetRaiseEnabled(), true);
62 property->SetRaiseEnabled(false);
63 ASSERT_EQ(property->GetRaiseEnabled(), false);
64 }
65 } // namespace
66 } // namespace Rosen
67 } // namespace OHOS
68