mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
- Introduced `FakeCrestronEnvironment` and `FakeEthernetHelper` for testing purposes. - Implemented `InMemoryCrestronDataStore` to facilitate unit tests for data storage. - Created `DebugServiceTests` to validate the behavior of debug-related services. - Added project files for unit tests targeting .NET 9.0 with necessary dependencies. - Developed production adapters (`CrestronConsoleAdapter`, `CrestronDataStoreAdapter`, `CrestronEnvironmentAdapter`, `CrestronEthernetAdapter`) to interface with the Crestron SDK. - Updated `Debug` class to utilize injected service abstractions instead of direct SDK calls. - Enhanced `ControlSystem` initialization to register service adapters before usage.
32 lines
1.2 KiB
C#
32 lines
1.2 KiB
C#
namespace PepperDash.Core.Abstractions;
|
|
|
|
/// <summary>
|
|
/// Abstracts <c>Crestron.SimplSharp.CrestronConsole</c> to allow unit testing
|
|
/// without the Crestron SDK.
|
|
/// </summary>
|
|
public interface ICrestronConsole
|
|
{
|
|
/// <summary>Prints a line to the Crestron console/telnet output.</summary>
|
|
void PrintLine(string message);
|
|
|
|
/// <summary>Prints text (without newline) to the Crestron console/telnet output.</summary>
|
|
void Print(string message);
|
|
|
|
/// <summary>
|
|
/// Sends a response string to the console for the currently-executing console command.
|
|
/// </summary>
|
|
void ConsoleCommandResponse(string message);
|
|
|
|
/// <summary>
|
|
/// Registers a new command with the Crestron console.
|
|
/// </summary>
|
|
/// <param name="callback">Handler invoked when the command is typed.</param>
|
|
/// <param name="command">Command name (no spaces).</param>
|
|
/// <param name="helpText">Help text shown by the Crestron console.</param>
|
|
/// <param name="accessLevel">Minimum access level required to run the command.</param>
|
|
void AddNewConsoleCommand(
|
|
Action<string> callback,
|
|
string command,
|
|
string helpText,
|
|
ConsoleAccessLevel accessLevel);
|
|
}
|