mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-03 06:44:58 +00:00
87 lines
2.4 KiB
C#
87 lines
2.4 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|