EX-Display
EX-Display
Loading...
Searching...
No Matches
MockDisplay.h
Go to the documentation of this file.
1/*
2 * © 2024 Peter Cole
3 *
4 * This is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * It is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this code. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef MOCKDISPLAY_H
19#define MOCKDISPLAY_H
20
21#include "DisplayInterface.h"
22#include "Screen.h"
23#include <gmock/gmock.h>
24
27public:
28 MOCK_METHOD(void, begin, (), (override));
29
30 MOCK_METHOD(void, clearScreen, (), (override));
31
32 MOCK_METHOD(void, displayScreen, (Screen * screen), (override));
33
34 MOCK_METHOD(void, displayStartupInfo, (const char *version), (override));
35
37 (uint8_t row, uint8_t column, RowAttributes attributes, const char *text, bool append), (override));
38
39 static MockDisplay *create() {
40 MockDisplay *newDisplay = new MockDisplay();
41 return newDisplay;
42 }
43};
44
45#endif // MOCKDISPLAY_H
Class to abstract away all physical display implementation to enable multiple display types.
Definition DisplayInterface.h:36
virtual void displayFormattedRow(uint8_t row, uint8_t column, RowAttributes attributes, const char *text, bool append)=0
Display a row using formatting modifiers.
virtual void displayStartupInfo(const char *version)=0
Display the startup screen with software version.
virtual void clearScreen()=0
Clear the entire screen.
virtual void begin()=0
Perform any initial once off setup or configuration here and call only once.
virtual void displayScreen(Screen *screen)=0
Display the specified Screen on this display.
Mock physical display class.
Definition MockDisplay.h:26
MOCK_METHOD(void, clearScreen,(),(override))
MOCK_METHOD(void, displayScreen,(Screen *screen),(override))
MOCK_METHOD(void, displayFormattedRow,(uint8_t row, uint8_t column, RowAttributes attributes, const char *text, bool append),(override))
static MockDisplay * create()
Definition MockDisplay.h:39
MOCK_METHOD(void, displayStartupInfo,(const char *version),(override))
MOCK_METHOD(void, begin,(),(override))
Class for each screen as received from the EXRAIL SCREEN() command Each Screen instance contains a li...
Definition Screen.h:27
Structure for row attributes.
Definition DisplayInterface.h:26