Skip to content

ReceiverTests

Namespace: UnitTests.MqttReceiver

Unit tests for the Receiver class, verifying MQTT topic subscription functionality.

public class ReceiverTests

Inheritance ObjectReceiverTests

Constructors

ReceiverTests()

public ReceiverTests()

Methods

Constructor_WithNullConnection_ThrowsArgumentNullException()

Tests that the Receiver constructor throws when connection is null.

public void Constructor_WithNullConnection_ThrowsArgumentNullException()

Constructor_WithNullLogger_ThrowsArgumentNullException()

Tests that the Receiver constructor throws when logger is null.

public void Constructor_WithNullLogger_ThrowsArgumentNullException()

Constructor_WithNullServiceProvider_ThrowsArgumentNullException()

Tests that the Receiver constructor throws when service provider is null.

public void Constructor_WithNullServiceProvider_ThrowsArgumentNullException()

Constructor_WithValidDependencies_InitializesSuccessfully()

Tests that the Receiver constructor properly initializes with valid dependencies.

public void Constructor_WithValidDependencies_InitializesSuccessfully()

Setup()

Sets up test fixtures and initializes mocks before each test execution.

public void Setup()

SubscribeToTopics_CompleteWorkflow_WorksCorrectly()

Tests the complete subscription workflow with realistic data.

public Task SubscribeToTopics_CompleteWorkflow_WorksCorrectly()

Returns

Task

SubscribeToTopics_CreatesAndDisposesServiceScope()

Tests that SubscribeToTopics properly creates and disposes of service scope.

public Task SubscribeToTopics_CreatesAndDisposesServiceScope()

Returns

Task

SubscribeToTopics_DisposesScope_EvenWhenExceptionOccurs()

Tests that SubscribeToTopics disposes scope even when exception occurs.

public Task SubscribeToTopics_DisposesScope_EvenWhenExceptionOccurs()

Returns

Task

SubscribeToTopics_WhenConnectionFails_PropagatesException()

Tests that SubscribeToTopics handles connection failures.

public Task SubscribeToTopics_WhenConnectionFails_PropagatesException()

Returns

Task

SubscribeToTopics_WhenRepositoryThrows_PropagatesException()

Tests that SubscribeToTopics handles repository exceptions.

public Task SubscribeToTopics_WhenRepositoryThrows_PropagatesException()

Returns

Task

SubscribeToTopics_WithEmptySettings_CompletesWithoutError()

Tests that SubscribeToTopics handles empty topic settings gracefully.

public Task SubscribeToTopics_WithEmptySettings_CompletesWithoutError()

Returns

Task

SubscribeToTopics_WithNullSettings_ThrowsException()

Tests that SubscribeToTopics handles null topic settings gracefully.

public Task SubscribeToTopics_WithNullSettings_ThrowsException()

Returns

Task

SubscribeToTopics_WithValidSettings_RetrievesSettingsAndConnects()

Tests that SubscribeToTopics retrieves topic settings and establishes connection.

public Task SubscribeToTopics_WithValidSettings_RetrievesSettingsAndConnects()

Returns

Task