-
-
Notifications
You must be signed in to change notification settings - Fork 313
Expand file tree
/
Copy pathCommandTests.cs
More file actions
38 lines (33 loc) · 827 Bytes
/
CommandTests.cs
File metadata and controls
38 lines (33 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using FluentAssertions;
using SysBot.Base;
using Xunit;
namespace SysBot.Tests;
public class CommandTests
{
[Fact]
public void ButtonTestA()
{
var poke = SwitchCommand.Click(SwitchButton.A);
var expect = "click A\r\n"u8;
expect.SequenceEqual(poke).Should().BeTrue();
}
[Fact]
public void ButtonTestX()
{
var poke = SwitchCommand.Click(SwitchButton.X);
var expect = "click X\r\n"u8;
expect.SequenceEqual(poke).Should().BeTrue();
}
}
public class DecodeTests
{
[Fact]
public void DecodeTest()
{
var raw = "010203040A0F"u8;
ReadOnlySpan<byte> expect = [1, 2, 3, 4, 10, 15];
var convert = Decoder.ConvertHexByteStringToBytes(raw);
expect.SequenceEqual(convert).Should().BeTrue();
}
}