24 lines
786 B
C#
24 lines
786 B
C#
using Heimdall.Application.Discovery.Commands.CancelTestSession;
|
|
using Heimdall.Application.Common;
|
|
using Heimdall.Application.Services;
|
|
using NSubstitute;
|
|
|
|
namespace Heimdall.Application.Tests.Handlers.Discovery;
|
|
|
|
public class CancelTestSessionHandlerTests
|
|
{
|
|
[Fact]
|
|
public async Task Cancel_test_session_should_return_success()
|
|
{
|
|
var service = Substitute.For<ICameraDiscoveryService>();
|
|
service.CancelTestSessionAsync(Arg.Any<Guid>(), Arg.Any<CancellationToken>())
|
|
.Returns(ServiceResult.Success());
|
|
var handler = new CancelTestSessionCommandHandler(service);
|
|
|
|
var result = await handler.Handle(
|
|
new CancelTestSessionCommand(Guid.NewGuid()), CancellationToken.None);
|
|
|
|
result.IsSuccess.ShouldBeTrue();
|
|
}
|
|
}
|