using e_suite.Messaging.Common.models;
using e_suite.Messaging.Common.UnitTests.Helpers;
using NUnit.Framework;

namespace e_suite.Messaging.Common.UnitTests;

[TestFixture]
public class SigmaImportMessageSenderUnitTests : SigmaImportMessageSenderTestBase
{
    [SetUp]
    public override async Task Setup()
    {
        await base.Setup();
    }

    [TearDown]
    public override async Task TearDown()
    {
        await base.TearDown();
    }

    [Test]
    public void NewDatabaseMessageSender_WhenCreated_DoesNotThrowException()
    {
        Assert.That(SigmaImportMessageSender, Is.Not.Null);
    }

    private const string BasicMessage = "{{\"MessageType\":{0}}}";

    [Test]
    public void PostImportGMGProfiles_WhenCalled_SendsCorrectMessage()
    {
        //Arrange
        // Act
        SigmaImportMessageSender.PostImportGMGProfiles();

        // Assert
        Assert.That(Body, Is.EqualTo(string.Format(BasicMessage, (int)SigmaImportMessageTypes.ImportGMGProfiles)));
    }

    [Test]
    public void PostImportPrintSpecifications_WhenCalled_SendsCorrectMessage()
    {
        //Arrange
        // Act
        SigmaImportMessageSender.PostImportPrintSpecifications();

        // Assert
        Assert.That(Body, Is.EqualTo(string.Format(BasicMessage, (int)SigmaImportMessageTypes.ImportPrintSpecifications)));
    }
}