Skip to content

Commit d995266

Browse files
authored
Merge pull request #33 from diogotr7/feature/cleanup
Refactor OpenRGBClient
2 parents 91b145f + 24f9611 commit d995266

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+812
-892
lines changed

src/OpenRGB.NET.Example/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
client.UpdateLeds(index, slice);
4545
}
4646

47-
Thread.Sleep(1000 / fps);
47+
Thread.Sleep(1000 / fps);
4848
}
4949
});
5050

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.IO;
2+
using OpenRGB.NET.Utils;
3+
using Xunit;
4+
5+
namespace OpenRGB.NET.Test;
6+
7+
public class BufferReadTests
8+
{
9+
[Fact]
10+
public void Test_Read_Device()
11+
{
12+
var buffer = File.ReadAllBytes(Path.Combine("TestData", "08-Receive-RequestControllerData.bin"));
13+
var spanReader = new SpanReader(buffer);
14+
var device = DeviceReader.ReadFrom(ref spanReader, ProtocolVersion.V4, 0);
15+
16+
Assert.Equal(0, device.Index);
17+
Assert.Equal("Full 104 key ", device.Name);
18+
}
19+
}

src/OpenRGB.NET.Tests/OpenRGB.NET.Tests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,9 @@
2424
<ItemGroup>
2525
<ProjectReference Include="..\OpenRGB.NET\OpenRGB.NET.csproj" />
2626
</ItemGroup>
27+
28+
<ItemGroup>
29+
<Content Include="TestData\*.bin" CopyToOutputDirectory="PreserveNewest"/>
30+
</ItemGroup>
2731

2832
</Project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)