refactor: split node agent and Go control plane
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using WxAgent.Core;
|
||||
using Xunit;
|
||||
|
||||
namespace WxAgent.Core.Tests;
|
||||
|
||||
public sealed class WechatNavigationTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(0)]
|
||||
[InlineData(101)]
|
||||
public void RejectsUnboundedScrollRequests(int pages) =>
|
||||
Assert.Throws<WxAgentException>(() => WechatNavigationRules.ValidateScrollLimit(pages));
|
||||
|
||||
[Fact]
|
||||
public void MatchesExactVisibleFingerprintAndRejectsAmbiguity()
|
||||
{
|
||||
var message = new ChatMessageSnapshot("test", new string('a', 64), 0, ChatMessageType.Text);
|
||||
Assert.Same(message, WechatNavigationRules.FindMessage([message], new string('A', 64)));
|
||||
Assert.Null(WechatNavigationRules.FindMessage([message], new string('b', 64)));
|
||||
Assert.Throws<WxAgentException>(() => WechatNavigationRules.FindMessage([message, message], message.Fingerprint));
|
||||
Assert.Throws<WxAgentException>(() => WechatNavigationRules.FindMessage([message], "not-a-fingerprint"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user