/*
* Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd.
*
* Author:     chenhaifeng  <chenhaifeng@uniontech.com>
*
* Maintainer: chenhaifeng  <chenhaifeng@uniontech.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#include "test_daywindow.h"

test_dayWindow::test_dayWindow()
{
}

void test_dayWindow::SetUp()
{
    QDateTime currentTime = QDateTime::currentDateTime();
    m_dayWindow = new CDayWindow();
    m_dayWindow->setCurrentDateTime(currentTime);
    m_dayWindow->setSelectDate(currentTime.date());
}

void test_dayWindow::TearDown()
{
    delete m_dayWindow;
    m_dayWindow = nullptr;
}

//测试paintevent
TEST_F(test_dayWindow, getPixmap)
{
    m_dayWindow->setFixedSize(800, 600);
    QPixmap pixmap(m_dayWindow->size());
    m_dayWindow->render(&pixmap);
}

//setTheme
TEST_F(test_dayWindow, setTheme)
{
    m_dayWindow->setTheMe(0);
    m_dayWindow->setTheMe(1);
    m_dayWindow->setTheMe(2);
}

//setSearchWFlag
TEST_F(test_dayWindow, setSearchWFlag)
{
    m_dayWindow->setSearchWFlag(false);
}

//slotChangeSelectDate
TEST_F(test_dayWindow, slotChangeSelectDate)
{
    m_dayWindow->slotChangeSelectDate(m_dayWindow->getSelectDate());
}

//slotSwitchPrePage
TEST_F(test_dayWindow, slotSwitchPrePage)
{
    m_dayWindow->slotSwitchPrePage();
}

//slotSwitchNextPage
TEST_F(test_dayWindow, slotSwitchNextPage)
{
    m_dayWindow->slotSwitchNextPage();
}
