// // FakeNostaleClient.cs // // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Threading; using System.Threading.Tasks; using NosSmooth.Core.Client; using NosSmooth.Core.Commands; using NosSmooth.Packets; using Remora.Results; namespace NosSmooth.Core.Tests.Fakes; /// /// Fake NosTale client. /// public class FakeNostaleClient : INostaleClient { private readonly Func _handleCommand; /// /// Initializes a new instance of the class. /// /// The handler for . public FakeNostaleClient(Func handleCommand) { _handleCommand = handleCommand; } /// public Task RunAsync(CancellationToken stopRequested = default) { throw new System.NotImplementedException(); } /// public Task SendPacketAsync(string packetString, CancellationToken ct = default) { throw new System.NotImplementedException(); } /// public Task ReceivePacketAsync(string packetString, CancellationToken ct = default) { throw new System.NotImplementedException(); } /// public Task SendCommandAsync(ICommand command, CancellationToken ct = default) => Task.FromResult(_handleCommand(command, ct)); }