1/* 2 * Copyright (c) 2020-2021 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 "common/screen.h" 17 18#include <climits> 19#include <gtest/gtest.h> 20 21using namespace testing::ext; 22namespace OHOS { 23class ScreenTest : public testing::Test { 24public: 25 static void SetUpTestCase(void) {} 26 static void TearDownTestCase(void) {} 27}; 28 29/** 30 * @tc.name: ScreenGetWidth_001 31 * @tc.desc: Verify GetWidth function, equal. 32 * @tc.type: FUNC 33 * @tc.require: AR000EEMQ9 34 */ 35HWTEST_F(ScreenTest, ScreenGetWidth_001, TestSize.Level1) 36{ 37 EXPECT_EQ(Screen::GetInstance().GetWidth(), HORIZONTAL_RESOLUTION); 38} 39 40/** 41 * @tc.name: ScreenGetHeight_001 42 * @tc.desc: Verify GetHeight function, equal. 43 * @tc.type: FUNC 44 * @tc.require: AR000EEMQ9 45 */ 46HWTEST_F(ScreenTest, ScreenGetHeight_001, TestSize.Level1) 47{ 48 EXPECT_EQ(Screen::GetInstance().GetHeight(), VERTICAL_RESOLUTION); 49} 50} // namespace OHOS 51