servicepoint-binding-csharp/ServicePoint.Tests/CommandTests.cs
Vinzenz Schroeter 178ab1eb74
Some checks failed
Rust / build (pull_request) Failing after 16s
separate types for commands
2025-06-16 16:41:46 +02:00

50 lines
1 KiB
C#

namespace ServicePoint.Tests;
public class CommandTests
{
private IConnection _connection = new FakeConnection();
[Fact]
public void ClearSendable()
{
_connection.Send(new ClearCommand());
}
[Fact]
public void GenericAsPacket()
{
var command = new ClearCommand();
Assert.Equal(command.AsPacket(), command.AsGeneric().AsPacket());
}
[Fact]
public void BrightnessSendable()
{
_connection.Send(new GlobalBrightnessCommand(5));
}
[Fact]
public void InvalidBrightnessThrows()
{
Assert.Throws<ServicePointException.InvalidBrightness>(() => new GlobalBrightnessCommand(42));
}
[Fact]
public void FadeOutSendable()
{
_connection.Send(new FadeOutCommand());
}
[Fact]
public void HardResetSendable()
{
_connection.Send(new HardResetCommand());
}
[Fact]
public void BitmapLinearWinSendable()
{
_connection.Send(new BitmapCommand(0, 0, Bitmap.NewMaxSized(), CompressionCode.Uncompressed));
}
}