Class FakeDriver
Implements a mock ConsoleDriver for unit testing
Inheritance
System.Object
FakeDriver
Assembly: Terminal.Gui.dll
Syntax
public class FakeDriver : ConsoleDriver
Constructors
FakeDriver()
Declaration
Properties
Clipboard
Declaration
public override IClipboard Clipboard { get; }
Property Value
Overrides
Cols
Declaration
public override int Cols { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
Overrides
Contents
Assists with testing, the format is rows, columns and 3 values on the last column: Rune, Attribute and Dirty Flag
Declaration
public override int[,, ] Contents { get; }
Property Value
| Type |
Description |
| System.Int32[,,] |
|
Overrides
HeightAsBuffer
Declaration
public override bool HeightAsBuffer { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
Overrides
Left
Declaration
public override int Left { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
Overrides
Rows
Declaration
public override int Rows { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
Overrides
Top
Declaration
public override int Top { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
Overrides
Methods
AddRune(Rune)
Declaration
public override void AddRune(Rune rune)
Parameters
| Type |
Name |
Description |
| System.Rune |
rune |
|
Overrides
AddStr(ustring)
Declaration
public override void AddStr(ustring str)
Parameters
| Type |
Name |
Description |
| NStack.ustring |
str |
|
Overrides
CookMouse()
Declaration
public override void CookMouse()
Overrides
End()
Declaration
public override void End()
Overrides
EnsureCursorVisibility()
Ensure the cursor visibility
Declaration
public override bool EnsureCursorVisibility()
Returns
| Type |
Description |
| System.Boolean |
true upon success |
Overrides
GetAttribute()
Declaration
public override Attribute GetAttribute()
Returns
Overrides
GetColors(Int32, out Color, out Color)
Declaration
public override bool GetColors(int value, out Color foreground, out Color background)
Parameters
| Type |
Name |
Description |
| System.Int32 |
value |
|
| Color |
foreground |
|
| Color |
background |
|
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
GetCursorVisibility(out CursorVisibility)
Retreive the cursor caret visibility
Declaration
public override bool GetCursorVisibility(out CursorVisibility visibility)
Parameters
Returns
| Type |
Description |
| System.Boolean |
true upon success |
Overrides
Init(Action)
Declaration
public override void Init(Action terminalResized)
Parameters
| Type |
Name |
Description |
| System.Action |
terminalResized |
|
Overrides
MakeAttribute(Color, Color)
Declaration
public override Attribute MakeAttribute(Color fore, Color back)
Parameters
Returns
Overrides
Move(Int32, Int32)
Declaration
public override void Move(int col, int row)
Parameters
| Type |
Name |
Description |
| System.Int32 |
col |
|
| System.Int32 |
row |
|
Overrides
PrepareToRun(MainLoop, Action<KeyEvent>, Action<KeyEvent>, Action<KeyEvent>, Action<MouseEvent>)
Declaration
public override void PrepareToRun(MainLoop mainLoop, Action<KeyEvent> keyHandler, Action<KeyEvent> keyDownHandler, Action<KeyEvent> keyUpHandler, Action<MouseEvent> mouseHandler)
Parameters
Overrides
Refresh()
Declaration
public override void Refresh()
Overrides
ResizeScreen()
Declaration
public override void ResizeScreen()
Overrides
SendKeys(Char, ConsoleKey, Boolean, Boolean, Boolean)
Declaration
public override void SendKeys(char keyChar, ConsoleKey key, bool shift, bool alt, bool control)
Parameters
| Type |
Name |
Description |
| System.Char |
keyChar |
|
| System.ConsoleKey |
key |
|
| System.Boolean |
shift |
|
| System.Boolean |
alt |
|
| System.Boolean |
control |
|
Overrides
SetAttribute(Attribute)
Declaration
public override void SetAttribute(Attribute c)
Parameters
Overrides
SetBufferSize(Int32, Int32)
Declaration
public void SetBufferSize(int width, int height)
Parameters
| Type |
Name |
Description |
| System.Int32 |
width |
|
| System.Int32 |
height |
|
SetColors(ConsoleColor, ConsoleColor)
Declaration
public override void SetColors(ConsoleColor foreground, ConsoleColor background)
Parameters
| Type |
Name |
Description |
| System.ConsoleColor |
foreground |
|
| System.ConsoleColor |
background |
|
Overrides
SetColors(Int16, Int16)
Declaration
public override void SetColors(short foregroundColorId, short backgroundColorId)
Parameters
| Type |
Name |
Description |
| System.Int16 |
foregroundColorId |
|
| System.Int16 |
backgroundColorId |
|
Overrides
SetCursorVisibility(CursorVisibility)
Change the cursor caret visibility
Declaration
public override bool SetCursorVisibility(CursorVisibility visibility)
Parameters
Returns
| Type |
Description |
| System.Boolean |
true upon success |
Overrides
SetWindowPosition(Int32, Int32)
Declaration
public void SetWindowPosition(int left, int top)
Parameters
| Type |
Name |
Description |
| System.Int32 |
left |
|
| System.Int32 |
top |
|
SetWindowSize(Int32, Int32)
Declaration
public void SetWindowSize(int width, int height)
Parameters
| Type |
Name |
Description |
| System.Int32 |
width |
|
| System.Int32 |
height |
|
StartReportingMouseMoves()
Declaration
public override void StartReportingMouseMoves()
Overrides
StopReportingMouseMoves()
Declaration
public override void StopReportingMouseMoves()
Overrides
Suspend()
Declaration
public override void Suspend()
Overrides
UncookMouse()
Declaration
public override void UncookMouse()
Overrides
UpdateCursor()
Declaration
public override void UpdateCursor()
Overrides
UpdateOffScreen()
Declaration
public override void UpdateOffScreen()
Overrides
UpdateScreen()
Declaration
public override void UpdateScreen()
Overrides