mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-14 04:04:58 +00:00
test: add crestron mocks and Test configuration
This commit is contained in:
86
tests/EssentialsTests/CrestronMockTest.cs
Normal file
86
tests/EssentialsTests/CrestronMockTest.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using Crestron.SimplSharpPro;
|
||||
using Xunit;
|
||||
|
||||
namespace EssentialsTests
|
||||
{
|
||||
public class CrestronMockTests
|
||||
{
|
||||
[Fact]
|
||||
public void CrestronControlSystem_Constructor_ShouldBuildSuccessfully()
|
||||
{
|
||||
// Arrange & Act
|
||||
var exception = Record.Exception(() => new CrestronControlSystem());
|
||||
|
||||
// Assert
|
||||
Assert.Null(exception);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CrestronControlSystem_Constructor_ShouldSetPropertiesCorrectly()
|
||||
{
|
||||
// Arrange & Act
|
||||
var controlSystem = new CrestronControlSystem();
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(controlSystem);
|
||||
Assert.NotNull(controlSystem.ComPorts);
|
||||
Assert.NotNull(controlSystem.RelayPorts);
|
||||
Assert.NotNull(controlSystem.IROutputPorts);
|
||||
Assert.NotNull(controlSystem.DigitalInputPorts);
|
||||
Assert.NotNull(controlSystem.IRInputPort);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CrestronControlSystem_InitializeSystem_ShouldNotThrow()
|
||||
{
|
||||
// Arrange
|
||||
var controlSystem = new CrestronControlSystem();
|
||||
|
||||
// Act & Assert
|
||||
var exception = Record.Exception(() => controlSystem.InitializeSystem());
|
||||
Assert.Null(exception);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MockControlSystem_ShouldHaveRequiredStaticProperties()
|
||||
{
|
||||
// Act & Assert
|
||||
Assert.NotNull(CrestronControlSystem.NullCue);
|
||||
Assert.NotNull(CrestronControlSystem.NullBoolInputSig);
|
||||
Assert.NotNull(CrestronControlSystem.NullBoolOutputSig);
|
||||
Assert.NotNull(CrestronControlSystem.NullUShortInputSig);
|
||||
Assert.NotNull(CrestronControlSystem.NullUShortOutputSig);
|
||||
Assert.NotNull(CrestronControlSystem.NullStringInputSig);
|
||||
Assert.NotNull(CrestronControlSystem.NullStringOutputSig);
|
||||
Assert.NotNull(CrestronControlSystem.SigGroups);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MockControlSystem_ShouldCreateSigGroups()
|
||||
{
|
||||
// Act & Assert
|
||||
var exception = Record.Exception(() =>
|
||||
{
|
||||
var sigGroup = CrestronControlSystem.CreateSigGroup(1, eSigType.Bool);
|
||||
Assert.NotNull(sigGroup);
|
||||
});
|
||||
|
||||
Assert.Null(exception);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MockControlSystem_VirtualMethods_ShouldNotThrow()
|
||||
{
|
||||
// Arrange
|
||||
var controlSystem = new CrestronControlSystem();
|
||||
|
||||
// Act & Assert - just test InitializeSystem since it's definitely available
|
||||
var exception = Record.Exception(() =>
|
||||
{
|
||||
controlSystem.InitializeSystem();
|
||||
});
|
||||
|
||||
Assert.Null(exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user