1
0
mirror of synced 2024-11-05 11:09:17 +00:00
Tapeti/Tapeti.Tests/Config/SimpleControllerTest.cs
Mark van Renswoude 178f0a4956 Implemented unit tests for QueueArguments attribute
Added proof-of-concept test for TapetiClient using Testcontainers.NET
Updated packages
2022-11-21 16:59:09 +01:00

43 lines
1.1 KiB
C#

using System.Linq;
using FluentAssertions;
using Tapeti.Annotations;
using Tapeti.Config;
using Xunit;
namespace Tapeti.Tests.Config
{
public class SimpleControllerTest : BaseControllerTest
{
[Fact]
public void RegisterController()
{
var bindings = GetControllerBindings<TestController>();
bindings.Should().HaveCount(1);
var handleSimpleMessageBinding = bindings.Single(b => b is IControllerMethodBinding cmb &&
cmb.Controller == typeof(TestController) &&
cmb.Method.Name == "HandleSimpleMessage");
handleSimpleMessageBinding.QueueType.Should().Be(QueueType.Dynamic);
}
// ReSharper disable all
#pragma warning disable
private class TestMessage
{
}
[DynamicQueue]
private class TestController
{
public void HandleSimpleMessage(TestMessage message)
{
}
}
#pragma warning restore
// ReSharper restore all
}
}