i have never done gtest befoere. so they asked me to refer this and write gtest for my ui.. can u help me with it? steps... //=========================================================================
//
//  SOURCE_FILE:    ReferenceHistoryTestV5.cpp
//  PACKAGE:        GUI
//  COMPONENT:      GUI
//  DESCRIPTION:    GUI module testcases for testing profile gui component
//  Copyright 2025: Koninklijke Philips Electronics N.V.
//
//=========================================================================

#include <gtest\gtest.h>

extern "C"
{
#include "gui_exp.h"
#include "gui_loc.h"
#include "gui_dgin.h"
#include "gui_main.h"
}
#include "string.h"
#include "TestUtility.h"
#include "GUIInterface.h"
#include "GuiGlobal.h"
#include "log_glo_stub.hpp"
#include "GuiController.h"
#include "ControlIDs.h"
#include "ReferenceHistoryView.h"
#include "admi_con_stub.h"
#include "Resources.h"
#include "view_int.h"

using namespace Gui;
using namespace Gui::Test;
using namespace MVSUI;

namespace DfiTest
{
    namespace GuiTest
    {
        constexpr int MAX_TIMEOUT = 500;
        class ReferenceHistoryTest : public ::testing::Test
        {
        public:

            ReferenceHistoryTest()
            {
            }

            virtual ~ReferenceHistoryTest()
            {
            }

            virtual void SetUp()
            {
                InitLogStub();
                Stubs::DisableCaptureLogOutput   = false;
                Stubs::DisableCaptureTraceOutput = false;

                TestUtility::GetInstance().Reset();

                GuiController::GetInstance().GetGuiDataModel()->Live.AcqGuidance3DdataModel.Visible  = false;
                GuiController::GetInstance().GetGuiDataModel()->Viewing.ReferenceHistory.Visbility   = true;
                GuiController::GetInstance().GetGuiDataModel()->General.Display.ScreenResolutionType = MVSUI::SCREEN_RESOLUTION_TYPE_ENUM::SCREEN_RESOLUTION_4K;
            }

            virtual void TearDown() {}

            void TestBody() {}

            void ShowReferenceHistoryPanel(GUI_REF_HIS_VIEW_ENUM viewType)
            {
                int status = OK;

                GUI_SIGNAL_STRUCT signalList[2];

                memset(&signalList[0], 0, sizeof(GUI_SIGNAL_STRUCT));
                signalList[0].scType = GUI_SC_CURSOR;
                signalList[0].scInfo.cursor.allWindows = 0;
                signalList[0].scInfo.cursor.type = GUI_CURSOR_ARROW;

                IGuiComponent* guiComponent = Gui::GuiController::GetInstance().GetComponentByID(GUI_SIGNAL_ENUM::GUI_SC_WINDOW_REFERENCE_HISTORY);

                memset(&signalList[1], 0, sizeof(GUI_SIGNAL_STRUCT));
                signalList[1].scType = GUI_SIGNAL_ENUM::GUI_SC_WINDOW_REFERENCE_HISTORY;
                signalList[1].scInfo.RefHisType.refHisView = viewType;

                status = guiComponent->Show(MONITOR_ENUM::MONITOR_VIEWPORT_4, signalList[1]);
                EXPECT_EQ(OK, status);
            }

            void HideReferenceHistoryPanel()
            {
                int status = OK;

                GUI_SIGNAL_STRUCT signalList[1];

                memset(&signalList[0], 0, sizeof(GUI_SIGNAL_STRUCT));
                signalList[0].scType = GUI_SIGNAL_ENUM::GUI_SC_WINDOW_REFERENCE_HISTORY;

                // Hide Admi Main screen.
                status = GUIInterface::GetInstance().RemoveSignal(MONITOR_VIEWPORT_4, 1, signalList);
                EXPECT_EQ(OK, status);
            }

            void GridView_UI_Verification()
            {
                // GridView Icons testing
                Sense::Image testImage;

                Sense::Image RefHis_btn_page_up_img = Resources::LoadIconFromResource(CONTROL_PAGE_UP_ENABLE_IMG);
                TestUtility::GetInstance().GetButtonCustomImage(REFERENCE_HISTORY_PREV_PAGE_BTN_IMAGE, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, RefHis_btn_page_up_img));

                Sense::Image RefHis_btn_page_down_img = Resources::LoadIconFromResource(CONTROL_PAGE_DOWN_ENABLE_IMG);
                TestUtility::GetInstance().GetButtonCustomImage(REFERENCE_HISTORY_NEXT_PAGE_BTN_IMAGE, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, RefHis_btn_page_down_img));

                Sense::Image parkToLiveImg = Resources::LoadIconFromResource(PARK_TO_LIVE_ENABLE_IMG);
                TestUtility::GetInstance().GetButtonCustomImage(REFERENCE_HISTORY_PARK_TO_LIVE_IMAGE, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, parkToLiveImg));

                Sense::Image parkToRef1_en = Resources::LoadIconFromResource(PARK_TO_REFERENCE1_ENABLE_IMG);
                TestUtility::GetInstance().GetButtonCustomImage(REFERENCE_HISTORY_PARK_TO_REFERENCE1_IMAGE, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, parkToRef1_en));

                Sense::Image parkToRef2_en = Resources::LoadIconFromResource(PARK_TO_REFERENCE2_ENABLE_IMG);
                TestUtility::GetInstance().GetButtonCustomImage(REFERENCE_HISTORY_PARK_TO_REFERENCE2_IMAGE, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, parkToRef2_en));

                Sense::Image prev_btn_img = Resources::LoadIconFromResource(PREVIOUS_BUTTON_ENABLE_IMG);
                TestUtility::GetInstance().GetButtonCustomImage(REFERENCE_HISTORY_BTN_PREVIOUS_IMAGE, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, prev_btn_img));

                Sense::Image btn_single_img = Resources::LoadIconFromResource(SINGLE_VIEW_ENABLE_IMG);
                TestUtility::GetInstance().GetButtonCustomImage(REFERENCE_HISTORY_BTN_SINGLE_IMAGE, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, btn_single_img));

                Sense::Image btn_nextPage_img = Resources::LoadIconFromResource(NEXT_BUTTON_ENABLE_IMG);
                TestUtility::GetInstance().GetButtonCustomImage(REFERENCE_HISTORY_BTN_NEXT_IMAGE, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, btn_nextPage_img));

                Sense::Image ref_navigation_bar_img = Resources::LoadIconFromResource(NAVIGATION_BAR_IMG);
                TestUtility::GetInstance().GetImageBoxImage(REFERENCE_HISTORY_REF_NAVIGATION_BAR_IMAGEBOX, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, ref_navigation_bar_img));

                Sense::Image page_navigation_img = Resources::LoadIconFromResource(PAGE_NUM_PANEL_ENABLE_IMG);
                TestUtility::GetInstance().GetImageBoxImage(REFERENCE_HISTORY_PAGE_NAVIGATION_BAR_IMAGEBOX, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, page_navigation_img));

                // GridView Position and Size testing
                Rect RefHistoryPanelExpectedSize = { 165.0, 1794.0, 1739.0, 1969.0 };
                Rect RefHistoryPanelActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_PANEL_TITLE);
                EXPECT_EQ(RefHistoryPanelExpectedSize, RefHistoryPanelActualSize);

                Rect radioBtnReference1ExpectedSize = { 1.0, 16.0, 303.0, 58.0 };
                Rect radioBtnReference1ActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE1);
                EXPECT_EQ(radioBtnReference1ExpectedSize, radioBtnReference1ActualSize);

                Rect radioBtnReference2ExpectedSize = { 1.0, 116.0, 303.0, 158.0 };
                Rect radioBtnReference2ActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE2);
                EXPECT_EQ(radioBtnReference2ExpectedSize, radioBtnReference2ActualSize);

                Rect RefNavigationBarExpectedSize = { 400.0, 79.0, 1194.0, 159.0 };
                Rect RefNavigationBarActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_REF_NAVIGATION_BAR_IMAGEBOX);
                EXPECT_EQ(RefNavigationBarExpectedSize, RefNavigationBarActualSize);

                Rect pageNavigationBarExpectedSize = { 1225.0, 78.0, 1565.0, 158.0 };
                Rect pageNavigationBarActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_PAGE_NAVIGATION_BAR_IMAGEBOX);
                EXPECT_EQ(pageNavigationBarExpectedSize, pageNavigationBarActualSize);

                Rect btnParkToLiveExpectedSize = { 452.0, 79.0, 532.0, 159.0 };
                Rect btnParkToLiveActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_PARK_TO_LIVE_IMAGE);
                EXPECT_EQ(btnParkToLiveExpectedSize, btnParkToLiveActualSize);

                Rect btnParkToRef1ExpectedSize = { 554.0, 79.0, 634.0, 159.0 };
                Rect btnParkToRef1ActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_PARK_TO_REFERENCE1_IMAGE);
                EXPECT_EQ(btnParkToRef1ExpectedSize, btnParkToRef1ActualSize);

                Rect btnParkToRef2ExpectedSize = { 654.0, 79.0, 734.0, 159.0 };
                Rect btnParkToRef2ActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_PARK_TO_REFERENCE2_IMAGE);
                EXPECT_EQ(btnParkToRef2ExpectedSize, btnParkToRef2ActualSize);

                Rect btnPreviousImgExpectedSize = { 811.0, 79.0, 891.0, 159.0 };
                Rect btnPreviousImgActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_BTN_PREVIOUS_IMAGE);
                EXPECT_EQ(btnPreviousImgExpectedSize, btnPreviousImgActualSize);

                Rect btnSingleImageViewExpectedSize = { 937.0, 79.0, 1017.0, 159.0 };
                Rect btnSingleImageViewActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_BTN_SINGLE_IMAGE);
                EXPECT_EQ(btnSingleImageViewExpectedSize, btnSingleImageViewActualSize);

                Rect btnNextImageExpectedSize = { 1062.0, 79.0, 1142.0, 159.0 };
                Rect btnNextImageActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_BTN_NEXT_IMAGE);
                EXPECT_EQ(btnNextImageExpectedSize, btnNextImageActualSize);

                Rect btnPageUpExpectedSize = { 1225.0, 78.0, 1305.0, 158.0 };
                Rect btnPageupActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_PREV_PAGE_BTN_IMAGE);
                EXPECT_EQ(btnPageUpExpectedSize, btnPageupActualSize);

                Rect btnPageDownExpectedSize = { 1485.0, 78.0, 1565.0, 158.0 };
                Rect btnPageDownActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_NEXT_PAGE_BTN_IMAGE);
                EXPECT_EQ(btnPageDownExpectedSize, btnPageDownActualSize);

                Rect labelRefPageNumExpectedSize = { 1295.0, 98.0, 1495.0, 138.0 };
                Rect labelRefPageNumActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_BTN_PAGE_LABEL);
                EXPECT_EQ(labelRefPageNumExpectedSize, labelRefPageNumActualSize);

                // GridView text testing
                EXPECT_STREQ(L"Reference 1", TestUtility::GetInstance().GetTextRadioButton(REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE1).c_str());
                EXPECT_STREQ(L"Reference 2", TestUtility::GetInstance().GetTextRadioButton(REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE2).c_str());
            }

            void SingleView_UI_Verification()
            {
                // SingleView Icons testing
                Sense::Image testImage;

                Sense::Image btnParkToLive_img = Resources::LoadIconFromResource(PARK_TO_LIVE_ENABLE_IMG);
                TestUtility::GetInstance().GetButtonCustomImage(REFERENCE_HISTORY_NAVIGATION_PARK_TO_LIVE_IMAGE, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, btnParkToLive_img));

                Sense::Image btnParkToRef1_img = Resources::LoadIconFromResource(PARK_TO_REFERENCE1_ENABLE_IMG);
                TestUtility::GetInstance().GetButtonCustomImage(REFERENCE_HISTORY_NAVIGATION_PARK_TO_REFERENCE1_IMAGE, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, btnParkToRef1_img));

                Sense::Image btnParkToRef2_img = Resources::LoadIconFromResource(PARK_TO_REFERENCE2_ENABLE_IMG);
                TestUtility::GetInstance().GetButtonCustomImage(REFERENCE_HISTORY_NAVIGATION_PARK_TO_REFERENCE2_IMAGE, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, btnParkToRef2_img));

                Sense::Image btnPreviousImage_img = Resources::LoadIconFromResource(PREVIOUS_BUTTON_ENABLE_IMG);
                TestUtility::GetInstance().GetButtonCustomImage(REFERENCE_HISTORY_NAVIGATION_BTN_PREVIOUS_IMAGE, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, btnPreviousImage_img));

                Sense::Image btnGridImageView_img = Resources::LoadIconFromResource(GRID_VIEW_ENABLE_IMG);
                TestUtility::GetInstance().GetButtonCustomImage(REFERENCE_HISTORY_NAVIGATION_BTN_SINGLE_IMAGE, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, btnGridImageView_img));

                Sense::Image btnNextImage_img = Resources::LoadIconFromResource(NEXT_BUTTON_ENABLE_IMG);
                TestUtility::GetInstance().GetButtonCustomImage(REFERENCE_HISTORY_NAVIGATION_BTN_NEXT_IMAGE, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, btnNextImage_img));

                Sense::Image RefNavigationBar_img = Resources::LoadIconFromResource(NAVIGATION_BAR_IMG);
                TestUtility::GetInstance().GetImageBoxImage(REFERENCE_HISTORY_NAVIGATION_BAR_IMAGEBOX, testImage);
                EXPECT_EQ(true, TestUtility::GetInstance().ImageCompare(testImage, RefNavigationBar_img));

                // SingleView Position and Size testing
                Rect RefHisNavigationBarPanelExpectedSize = { 530.0, 1865.0, 1330.0, 1955.0 };
                Rect RefHisNavigationBarPanelActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_NAVIGATION_PANEL_TITLE);
                EXPECT_EQ(RefHisNavigationBarPanelExpectedSize, RefHisNavigationBarPanelActualSize);

                Rect RefNavigationBarExpectedSize = { 3.0, 5.0, 797.0, 85.0 };
                Rect RefNavigationBarActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_NAVIGATION_BAR_IMAGEBOX);
                EXPECT_EQ(RefNavigationBarExpectedSize, RefNavigationBarActualSize);

                Rect btnParkToLiveExpectedSize = { 55.0, 5.0, 135.0, 85.0 };
                Rect btnParkToLiveActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_NAVIGATION_PARK_TO_LIVE_IMAGE);
                EXPECT_EQ(btnParkToLiveExpectedSize, btnParkToLiveActualSize);

                Rect btnParkToRef1ExpectedSize = { 157.0, 5.0, 237.0, 85.0 };
                Rect btnParkToRef1ActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_NAVIGATION_PARK_TO_REFERENCE1_IMAGE);
                EXPECT_EQ(btnParkToRef1ExpectedSize, btnParkToRef1ActualSize);

                Rect btnParkToRef2ExpectedSize = { 257.0, 5.0, 337.0, 85.0 };
                Rect btnParkToRef2ActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_NAVIGATION_PARK_TO_REFERENCE2_IMAGE);
                EXPECT_EQ(btnParkToRef2ExpectedSize, btnParkToRef2ActualSize);

                Rect btnPreviousImgExpectedSize = { 414.0, 5.0, 494.0, 85.0 };
                Rect btnPreviousImgActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_NAVIGATION_BTN_PREVIOUS_IMAGE);
                EXPECT_EQ(btnPreviousImgExpectedSize, btnPreviousImgActualSize);

                Rect btnSingleImageViewExpectedSize = { 540.0, 5.0, 620.0, 85.0 };
                Rect btnSingleImageViewActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_NAVIGATION_BTN_SINGLE_IMAGE);
                EXPECT_EQ(btnSingleImageViewExpectedSize, btnSingleImageViewActualSize);

                Rect btnNextImageExpectedSize = { 665.0, 5.0, 745.0, 85.0 };
                Rect btnNextImageActualSize = Gui::Test::TestUtility::GetInstance().GetControlBounds(REFERENCE_HISTORY_NAVIGATION_BTN_NEXT_IMAGE);
                EXPECT_EQ(btnNextImageExpectedSize, btnNextImageActualSize);
            }

            void OverviewSetup()
            {
                GUI_SIGNAL_STRUCT signalOverlay;
                signalOverlay.scType = GUI_SC_WINDOW_OVERVIEW;
                int status = GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, &signalOverlay);
                EXPECT_EQ(OK, status);
            }
        };

        /* TODO: Will enable as part of google test implementation story */
        TEST_F(ReferenceHistoryTest,ReferenceHistory_GridView_Test)
        {
            ShowReferenceHistoryPanel(GUI_GRID_VIEW);

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_PANEL_TITLE));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_PANEL_TITLE));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE1));
            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE2));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_REF_NAVIGATION_BAR_IMAGEBOX));
            EXPECT_FALSE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_REF_NAVIGATION_BAR_IMAGEBOX));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_PAGE_NAVIGATION_BAR_IMAGEBOX));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_PAGE_NAVIGATION_BAR_IMAGEBOX));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_PARK_TO_LIVE_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_PARK_TO_LIVE_IMAGE));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_PARK_TO_REFERENCE1_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_PARK_TO_REFERENCE1_IMAGE));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_PARK_TO_REFERENCE2_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_PARK_TO_REFERENCE2_IMAGE));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_BTN_SINGLE_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_BTN_SINGLE_IMAGE));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_BTN_PREVIOUS_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_BTN_NEXT_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_PREV_PAGE_BTN_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_NEXT_PAGE_BTN_IMAGE));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_BTN_PAGE_LABEL));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_BTN_PAGE_LABEL));

            GridView_UI_Verification();

            HideReferenceHistoryPanel();

            ASSERT_FALSE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_PANEL_TITLE));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_PANEL_TITLE));
        }

        TEST_F(ReferenceHistoryTest, ReferenceHistory_SingleView_Test)
        {
            ShowReferenceHistoryPanel(GUI_SINGLE_VIEW);

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_NAVIGATION_PANEL_TITLE));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_NAVIGATION_PANEL_TITLE));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_NAVIGATION_PARK_TO_LIVE_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_NAVIGATION_PARK_TO_LIVE_IMAGE));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_NAVIGATION_PARK_TO_REFERENCE1_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_NAVIGATION_PARK_TO_REFERENCE1_IMAGE));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_NAVIGATION_PARK_TO_REFERENCE2_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_NAVIGATION_PARK_TO_REFERENCE2_IMAGE));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_NAVIGATION_BTN_PREVIOUS_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_NAVIGATION_BTN_PREVIOUS_IMAGE));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_NAVIGATION_BTN_SINGLE_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_NAVIGATION_BTN_SINGLE_IMAGE));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_NAVIGATION_BTN_NEXT_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_NAVIGATION_BTN_NEXT_IMAGE));

            EXPECT_TRUE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_NAVIGATION_BAR_IMAGEBOX));
            EXPECT_FALSE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_NAVIGATION_BAR_IMAGEBOX));

            SingleView_UI_Verification();

            HideReferenceHistoryPanel();

            ASSERT_FALSE(TestUtility::GetInstance().IsVisibleSync(REFERENCE_HISTORY_NAVIGATION_PANEL_TITLE));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(REFERENCE_HISTORY_NAVIGATION_PANEL_TITLE));
        }

        TEST_F(ReferenceHistoryTest, Gui_ReferenceHistory_Reference1_And_Reference2_Page_Active)
        {
            //show reference history panel
            ShowReferenceHistoryPanel(GUI_GRID_VIEW);

            //Setup for overview window
            OverviewSetup();

            //Verify overlay visibility
            EXPECT_TRUE(TestUtility::GetInstance().GetVisibility(MVSUI::OVERVIEW_IMAGE_OVERLAY_REFHISTORY));

            //Setup for reference1 and reference2 radio button
            GUI_SIGNAL_STRUCT guiSignal[1];
            guiSignal[0].scType = GUI_SC_WINDOW_REFERENCE_HISTORY;
            guiSignal[0].scInfo.RefHisType.refHisView = GUI_GRID_VIEW;
            guiSignal[0].scInfo.RefHisType.ref1Active = TRUE;
            guiSignal[0].scInfo.RefHisType.ref2Active = TRUE;
            guiSignal[0].scInfo.RefHisType.nextPageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevPageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.nextImageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevImageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.currentPage = 1;
            guiSignal[0].scInfo.RefHisType.totalPage = 1;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            //Validate reference1 radio button and reference2 radio button are enabled
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(MVSUI::REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE1));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(MVSUI::REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE2));
        }

        TEST_F(ReferenceHistoryTest, Gui_ReferenceHistory_Reference1_Page_Active_And_Select)
        {
            //show reference history panel
            ShowReferenceHistoryPanel(GUI_GRID_VIEW);

            //Setup for overview window
            OverviewSetup();

            //Verify overlay visibility
            EXPECT_TRUE(TestUtility::GetInstance().GetVisibility(MVSUI::OVERVIEW_IMAGE_OVERLAY_REFHISTORY));

            //Setup for reference1 and reference2 radio button
            GUI_SIGNAL_STRUCT guiSignal[1];
            guiSignal[0].scType = GUI_SC_WINDOW_REFERENCE_HISTORY;
            guiSignal[0].scInfo.RefHisType.refHisView = GUI_GRID_VIEW;
            guiSignal[0].scInfo.RefHisType.ref1Active = TRUE;
            guiSignal[0].scInfo.RefHisType.ref2Active = FALSE;
            guiSignal[0].scInfo.RefHisType.nextPageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevPageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.nextImageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevImageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.currentPage = 1;
            guiSignal[0].scInfo.RefHisType.totalPage = 1;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            //Validate reference1 radio button is enabled and reference2 radio button is disabled
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(MVSUI::REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE1));
            EXPECT_FALSE(TestUtility::GetInstance().IsEnabled(MVSUI::REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE2));

            CC_ACT_STRUCT ccID[1];
            GUI_ACTION_STRUCT resultPtr[1];
            GUI_ACTION_ENUM action = GUI_AC_REF_HIST_ACTION;

            int status = GUIInterface::GetInstance().ActionRequest(ccID[0], MONITOR_VIEWPORT_4, 1, &action, &resultPtr[0]);
            EXPECT_EQ(OK, status);

            //Reference1 radio button is clicked
            TestUtility::GetInstance().RadioButtonClicked(MVSUI::REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE1);
            EXPECT_EQ(OK, GUIInterface::GetInstance().WaitForReply(1, &ccID[0], MAX_TIMEOUT));

            //Validate radio button states
            EXPECT_TRUE(TestUtility::GetInstance().IsRadioButtonChecked(MVSUI::REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE1));
            EXPECT_FALSE(TestUtility::GetInstance().IsRadioButtonChecked(MVSUI::REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE2));

            //verify reference1 is clicked
            EXPECT_EQ(GUI_AC_REF_HIST_ACTION, resultPtr[0].acType);
            EXPECT_EQ(REF_LIST_ACTION_SWITCH_TO_REF1, resultPtr[0].acInfo.referenceHistory.refHisAction);

            HideReferenceHistoryPanel();
        }

        TEST_F(ReferenceHistoryTest, Gui_ReferenceHistory_Reference2__Page_Active_And_Select)
        {
            //show reference history panel
            ShowReferenceHistoryPanel(GUI_GRID_VIEW);

            //Setup for overview window
            OverviewSetup();

            //Verify overlay visibility
            EXPECT_TRUE(TestUtility::GetInstance().GetVisibility(MVSUI::OVERVIEW_IMAGE_OVERLAY_REFHISTORY));

            //Setup for reference1 and reference2 radio button
            GUI_SIGNAL_STRUCT guiSignal[1];
            guiSignal[0].scType = GUI_SC_WINDOW_REFERENCE_HISTORY;
            guiSignal[0].scInfo.RefHisType.refHisView = GUI_GRID_VIEW;
            guiSignal[0].scInfo.RefHisType.ref1Active = FALSE;
            guiSignal[0].scInfo.RefHisType.ref2Active = TRUE;
            guiSignal[0].scInfo.RefHisType.nextPageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevPageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.nextImageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevImageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.currentPage = 1;
            guiSignal[0].scInfo.RefHisType.totalPage = 1;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            //Validate reference1 radio button is disabled and reference2 radio button is enabled
            EXPECT_FALSE(TestUtility::GetInstance().IsEnabled(MVSUI::REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE1));
            EXPECT_TRUE(TestUtility::GetInstance().IsEnabled(MVSUI::REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE2));

            CC_ACT_STRUCT ccID[1];
            GUI_ACTION_STRUCT resultPtr[1];
            GUI_ACTION_ENUM action = GUI_AC_REF_HIST_ACTION;

            int status = GUIInterface::GetInstance().ActionRequest(ccID[0], MONITOR_VIEWPORT_4, 1, &action, &resultPtr[0]);
            EXPECT_EQ(OK, status);

            //Reference2 radio button is clicked
            TestUtility::GetInstance().RadioButtonClicked(MVSUI::REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE2);
            EXPECT_EQ(OK, GUIInterface::GetInstance().WaitForReply(1, &ccID[0], MAX_TIMEOUT));

            //Validate radio button states
            EXPECT_TRUE(TestUtility::GetInstance().IsRadioButtonChecked(MVSUI::REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE2));
            EXPECT_FALSE(TestUtility::GetInstance().IsRadioButtonChecked(MVSUI::REFERENCE_HISTORY_RADIO_BUTTON_REFERENCE1));

            //verify reference2 is clicked
            EXPECT_EQ(GUI_AC_REF_HIST_ACTION, resultPtr[0].acType);
            EXPECT_EQ(REF_LIST_ACTION_SWITCH_TO_REF2, resultPtr[0].acInfo.referenceHistory.refHisAction);

            HideReferenceHistoryPanel();
        }

        TEST_F(ReferenceHistoryTest, Gui_ReferenceHistory_DisplayPage_PageNavigationButtonState)
        {
            //show reference history panel
            ShowReferenceHistoryPanel(GUI_GRID_VIEW);

            //Setup for overview window
            OverviewSetup();

            //Verify overlay visibility
            EXPECT_TRUE(TestUtility::GetInstance().GetVisibility(MVSUI::OVERVIEW_IMAGE_OVERLAY_REFHISTORY));

            //Setup
            GUI_SIGNAL_STRUCT guiSignal[1];
            guiSignal[0].scType = GUI_SC_WINDOW_REFERENCE_HISTORY;
            guiSignal[0].scInfo.RefHisType.refHisView = GUI_GRID_VIEW;
            guiSignal[0].scInfo.RefHisType.ref1Active = TRUE;
            guiSignal[0].scInfo.RefHisType.ref2Active = FALSE;
            guiSignal[0].scInfo.RefHisType.nextImageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevImageActive = TRUE;

            //TC1: Total pages =1 
            guiSignal[0].scInfo.RefHisType.nextPageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevPageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.currentPage = 1;
            guiSignal[0].scInfo.RefHisType.totalPage = 1;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            EXPECT_FALSE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_PREV_PAGE_BTN_IMAGE));
            EXPECT_FALSE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_NEXT_PAGE_BTN_IMAGE));
            EXPECT_STREQ(L"Pg 1 of 1", TestUtility::GetInstance().GetTextInLabel(REFERENCE_HISTORY_BTN_PAGE_LABEL).c_str());

            //TC2: Total pages =3, current page=1 
            guiSignal[0].scInfo.RefHisType.currentPage = 1;
            guiSignal[0].scInfo.RefHisType.totalPage = 3;
            guiSignal[0].scInfo.RefHisType.nextPageActive = TRUE;
            guiSignal[0].scInfo.RefHisType.prevPageActive = FALSE;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            //Verify previous page button is disabled and next page button is enabled
            EXPECT_FALSE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_PREV_PAGE_BTN_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_NEXT_PAGE_BTN_IMAGE));
            EXPECT_STREQ(L"Pg 1 of 3", TestUtility::GetInstance().GetTextInLabel(REFERENCE_HISTORY_BTN_PAGE_LABEL).c_str());

            //TC2: Total pages =3, current page=2 
            guiSignal[0].scInfo.RefHisType.currentPage = 2;
            guiSignal[0].scInfo.RefHisType.totalPage = 3;
            guiSignal[0].scInfo.RefHisType.nextPageActive = TRUE;
            guiSignal[0].scInfo.RefHisType.prevPageActive = TRUE;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            //Verify previous page button is enabled and next page button is enabled
            EXPECT_TRUE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_PREV_PAGE_BTN_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_NEXT_PAGE_BTN_IMAGE));
            EXPECT_STREQ(L"Pg 2 of 3", TestUtility::GetInstance().GetTextInLabel(REFERENCE_HISTORY_BTN_PAGE_LABEL).c_str());

            //TC2: Total pages =3, current page=3
            guiSignal[0].scInfo.RefHisType.currentPage = 3;
            guiSignal[0].scInfo.RefHisType.totalPage = 3;
            guiSignal[0].scInfo.RefHisType.nextPageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevPageActive = TRUE;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            //Verify previous page button is enabled and next page button is enabled
            EXPECT_TRUE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_PREV_PAGE_BTN_IMAGE));
            EXPECT_FALSE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_NEXT_PAGE_BTN_IMAGE));
            EXPECT_STREQ(L"Pg 3 of 3", TestUtility::GetInstance().GetTextInLabel(REFERENCE_HISTORY_BTN_PAGE_LABEL).c_str());
        }

        TEST_F(ReferenceHistoryTest, Gui_ReferenceHistory_Select_PreviousPage)
        {
            //show reference history panel
            ShowReferenceHistoryPanel(GUI_GRID_VIEW);

            //Setup for overview window
            OverviewSetup();

            //Verify overlay visibility
            EXPECT_TRUE(TestUtility::GetInstance().GetVisibility(MVSUI::OVERVIEW_IMAGE_OVERLAY_REFHISTORY));

            //Setup
            GUI_SIGNAL_STRUCT guiSignal[1];
            guiSignal[0].scType = GUI_SC_WINDOW_REFERENCE_HISTORY;
            guiSignal[0].scInfo.RefHisType.refHisView = GUI_GRID_VIEW;
            guiSignal[0].scInfo.RefHisType.ref1Active = TRUE;
            guiSignal[0].scInfo.RefHisType.ref2Active = FALSE;
            guiSignal[0].scInfo.RefHisType.nextImageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevImageActive = TRUE;
            guiSignal[0].scInfo.RefHisType.nextPageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevPageActive = TRUE;
            guiSignal[0].scInfo.RefHisType.currentPage = 2;
            guiSignal[0].scInfo.RefHisType.totalPage = 2;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            CC_ACT_STRUCT ccID[1];
            GUI_ACTION_STRUCT resultPtr[1];
            GUI_ACTION_ENUM action = GUI_AC_REF_HIST_ACTION;

            int status = GUIInterface::GetInstance().ActionRequest(ccID[0], MONITOR_VIEWPORT_4, 1, &action, &resultPtr[0]);
            EXPECT_EQ(OK, status);

            //Previous Page button is clicked
            TestUtility::GetInstance().ClickCustomButton(MVSUI::REFERENCE_HISTORY_PREV_PAGE_BTN_IMAGE);
            EXPECT_EQ(OK, GUIInterface::GetInstance().WaitForReply(1, &ccID[0], MAX_TIMEOUT));

            //verify Previous Page button is clicked
            EXPECT_EQ(GUI_AC_REF_HIST_ACTION, resultPtr[0].acType);
            EXPECT_EQ(REF_LIST_ACTION_PREV_PAGE, resultPtr[0].acInfo.referenceHistory.refHisAction);

            HideReferenceHistoryPanel();
        }

        TEST_F(ReferenceHistoryTest, Gui_ReferenceHistory_Select_NextPage)
        {
            //show reference history panel
            ShowReferenceHistoryPanel(GUI_GRID_VIEW);

            //Setup for overview window
            OverviewSetup();

            //Verify overlay visibility
            EXPECT_TRUE(TestUtility::GetInstance().GetVisibility(MVSUI::OVERVIEW_IMAGE_OVERLAY_REFHISTORY));

            //Setup
            GUI_SIGNAL_STRUCT guiSignal[1];
            guiSignal[0].scType = GUI_SC_WINDOW_REFERENCE_HISTORY;
            guiSignal[0].scInfo.RefHisType.refHisView = GUI_GRID_VIEW;
            guiSignal[0].scInfo.RefHisType.ref1Active = TRUE;
            guiSignal[0].scInfo.RefHisType.ref2Active = FALSE;
            guiSignal[0].scInfo.RefHisType.nextImageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevImageActive = TRUE;
            guiSignal[0].scInfo.RefHisType.nextPageActive = TRUE;
            guiSignal[0].scInfo.RefHisType.prevPageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.currentPage = 1;
            guiSignal[0].scInfo.RefHisType.totalPage = 2;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            CC_ACT_STRUCT ccID[1];
            GUI_ACTION_STRUCT resultPtr[1];
            GUI_ACTION_ENUM action = GUI_AC_REF_HIST_ACTION;

            int status = GUIInterface::GetInstance().ActionRequest(ccID[0], MONITOR_VIEWPORT_4, 1, &action, &resultPtr[0]);
            EXPECT_EQ(OK, status);

            //Next Page button is clicked
            TestUtility::GetInstance().ClickCustomButton(MVSUI::REFERENCE_HISTORY_NEXT_PAGE_BTN_IMAGE);
            EXPECT_EQ(OK, GUIInterface::GetInstance().WaitForReply(1, &ccID[0], MAX_TIMEOUT));

            //verify Next Page button is clicked
            EXPECT_EQ(GUI_AC_REF_HIST_ACTION, resultPtr[0].acType);
            EXPECT_EQ(REF_LIST_ACTION_NEXT_PAGE, resultPtr[0].acInfo.referenceHistory.refHisAction);

            HideReferenceHistoryPanel();
        }

        TEST_F(ReferenceHistoryTest, Gui_ReferenceHistory_Select_NextImage)
        {
            //show reference history panel
            ShowReferenceHistoryPanel(GUI_GRID_VIEW);

            //Setup for overview window
            OverviewSetup();

            //Verify overlay visibility
            EXPECT_TRUE(TestUtility::GetInstance().GetVisibility(MVSUI::OVERVIEW_IMAGE_OVERLAY_REFHISTORY));

            //Setup
            GUI_SIGNAL_STRUCT guiSignal[1];
            guiSignal[0].scType = GUI_SC_WINDOW_REFERENCE_HISTORY;
            guiSignal[0].scInfo.RefHisType.refHisView = GUI_GRID_VIEW;
            guiSignal[0].scInfo.RefHisType.ref1Active = TRUE;
            guiSignal[0].scInfo.RefHisType.ref2Active = FALSE;
            guiSignal[0].scInfo.RefHisType.nextImageActive = TRUE;
            guiSignal[0].scInfo.RefHisType.prevImageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.nextPageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevPageActive = TRUE;
            guiSignal[0].scInfo.RefHisType.currentPage = 1;
            guiSignal[0].scInfo.RefHisType.totalPage = 2;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            CC_ACT_STRUCT ccID[1];
            GUI_ACTION_STRUCT resultPtr[1];
            GUI_ACTION_ENUM action = GUI_AC_REF_HIST_ACTION;

            int status = GUIInterface::GetInstance().ActionRequest(ccID[0], MONITOR_VIEWPORT_4, 1, &action, &resultPtr[0]);
            EXPECT_EQ(OK, status);

            //Next Image button is clicked
            TestUtility::GetInstance().ClickCustomButton(MVSUI::REFERENCE_HISTORY_BTN_NEXT_IMAGE);
            EXPECT_EQ(OK, GUIInterface::GetInstance().WaitForReply(1, &ccID[0], MAX_TIMEOUT));

            //verify Next Image button is clicked
            EXPECT_EQ(GUI_AC_REF_HIST_ACTION, resultPtr[0].acType);
            EXPECT_EQ(REF_LIST_ACTION_NEXT_IMAGE, resultPtr[0].acInfo.referenceHistory.refHisAction);

            HideReferenceHistoryPanel();
        }

        TEST_F(ReferenceHistoryTest, Gui_ReferenceHistory_Select_PreviuosImage)
        {
            //show reference history panel
            ShowReferenceHistoryPanel(GUI_GRID_VIEW);

            //Setup for overview window
            OverviewSetup();

            //Verify overlay visibility
            EXPECT_TRUE(TestUtility::GetInstance().GetVisibility(MVSUI::OVERVIEW_IMAGE_OVERLAY_REFHISTORY));

            //Setup
            GUI_SIGNAL_STRUCT guiSignal[1];
            guiSignal[0].scType = GUI_SC_WINDOW_REFERENCE_HISTORY;
            guiSignal[0].scInfo.RefHisType.refHisView = GUI_GRID_VIEW;
            guiSignal[0].scInfo.RefHisType.ref1Active = TRUE;
            guiSignal[0].scInfo.RefHisType.ref2Active = FALSE;
            guiSignal[0].scInfo.RefHisType.nextImageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevImageActive = TRUE;
            guiSignal[0].scInfo.RefHisType.nextPageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevPageActive = TRUE;
            guiSignal[0].scInfo.RefHisType.currentPage = 1;
            guiSignal[0].scInfo.RefHisType.totalPage = 2;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            EXPECT_TRUE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_BTN_PREVIOUS_IMAGE));
            EXPECT_FALSE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_BTN_NEXT_IMAGE));

            CC_ACT_STRUCT ccID[1];
            GUI_ACTION_STRUCT resultPtr[1];
            GUI_ACTION_ENUM action = GUI_AC_REF_HIST_ACTION;

            int status = GUIInterface::GetInstance().ActionRequest(ccID[0], MONITOR_VIEWPORT_4, 1, &action, &resultPtr[0]);
            EXPECT_EQ(OK, status);

            //Previous Image button is clicked
            TestUtility::GetInstance().ClickCustomButton(MVSUI::REFERENCE_HISTORY_BTN_PREVIOUS_IMAGE);
            EXPECT_EQ(OK, GUIInterface::GetInstance().WaitForReply(1, &ccID[0], MAX_TIMEOUT));

            //verify Previous Image button is clicked
            EXPECT_EQ(GUI_AC_REF_HIST_ACTION, resultPtr[0].acType);
            EXPECT_EQ(REF_LIST_ACTION_PREV_IMAGE, resultPtr[0].acInfo.referenceHistory.refHisAction);

            HideReferenceHistoryPanel();
        }

        TEST_F(ReferenceHistoryTest, Gui_ReferenceHistory_DisplayPage_ImageNavigationButtonState)
        {
            //show reference history panel
            ShowReferenceHistoryPanel(GUI_GRID_VIEW);

            //Setup for overview window
            OverviewSetup();

            //Verify overlay visibility
            EXPECT_TRUE(TestUtility::GetInstance().GetVisibility(MVSUI::OVERVIEW_IMAGE_OVERLAY_REFHISTORY));

            //Setup
            GUI_SIGNAL_STRUCT guiSignal[1];
            guiSignal[0].scType = GUI_SC_WINDOW_REFERENCE_HISTORY;
            guiSignal[0].scInfo.RefHisType.refHisView = GUI_GRID_VIEW;
            guiSignal[0].scInfo.RefHisType.ref1Active = TRUE;
            guiSignal[0].scInfo.RefHisType.ref2Active = FALSE;
            guiSignal[0].scInfo.RefHisType.nextPageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevPageActive = TRUE;
            guiSignal[0].scInfo.RefHisType.currentPage = 1;
            guiSignal[0].scInfo.RefHisType.totalPage = 2;

            //TC1: Single image
            guiSignal[0].scInfo.RefHisType.nextImageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevImageActive = FALSE;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            EXPECT_FALSE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_BTN_NEXT_IMAGE));
            EXPECT_FALSE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_BTN_PREVIOUS_IMAGE));
            
            //TC2: Last image
            guiSignal[0].scInfo.RefHisType.nextImageActive = FALSE;
            guiSignal[0].scInfo.RefHisType.prevImageActive = TRUE;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            EXPECT_FALSE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_BTN_NEXT_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_BTN_PREVIOUS_IMAGE));

            //TC3: First Image
            guiSignal[0].scInfo.RefHisType.nextImageActive = TRUE;
            guiSignal[0].scInfo.RefHisType.prevImageActive = FALSE;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            EXPECT_TRUE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_BTN_NEXT_IMAGE));
            EXPECT_FALSE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_BTN_PREVIOUS_IMAGE));

            //TC4: Middle Image
            guiSignal[0].scInfo.RefHisType.nextImageActive = TRUE;
            guiSignal[0].scInfo.RefHisType.prevImageActive = TRUE;
            GUIInterface::GetInstance().IndicateSignal(MONITOR_VIEWPORT_4, 1, guiSignal);

            EXPECT_TRUE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_BTN_NEXT_IMAGE));
            EXPECT_TRUE(TestUtility::GetInstance().IsCustomButtonEnabled(MVSUI::REFERENCE_HISTORY_BTN_PREVIOUS_IMAGE));
            
            HideReferenceHistoryPanel();
        }
    }
}