ReceiverTests¶
Namespace: UnitTests.MqttReceiver
Unit tests for the Receiver class, verifying MQTT topic subscription functionality.
Inheritance Object → ReceiverTests
Constructors¶
ReceiverTests()¶
Methods¶
Constructor_WithNullConnection_ThrowsArgumentNullException()¶
Tests that the Receiver constructor throws when connection is null.
Constructor_WithNullLogger_ThrowsArgumentNullException()¶
Tests that the Receiver constructor throws when logger is null.
Constructor_WithNullServiceProvider_ThrowsArgumentNullException()¶
Tests that the Receiver constructor throws when service provider is null.
Constructor_WithValidDependencies_InitializesSuccessfully()¶
Tests that the Receiver constructor properly initializes with valid dependencies.
Setup()¶
Sets up test fixtures and initializes mocks before each test execution.
SubscribeToTopics_CompleteWorkflow_WorksCorrectly()¶
Tests the complete subscription workflow with realistic data.
Returns¶
SubscribeToTopics_CreatesAndDisposesServiceScope()¶
Tests that SubscribeToTopics properly creates and disposes of service scope.
Returns¶
SubscribeToTopics_DisposesScope_EvenWhenExceptionOccurs()¶
Tests that SubscribeToTopics disposes scope even when exception occurs.
Returns¶
SubscribeToTopics_WhenConnectionFails_PropagatesException()¶
Tests that SubscribeToTopics handles connection failures.
Returns¶
SubscribeToTopics_WhenRepositoryThrows_PropagatesException()¶
Tests that SubscribeToTopics handles repository exceptions.
Returns¶
SubscribeToTopics_WithEmptySettings_CompletesWithoutError()¶
Tests that SubscribeToTopics handles empty topic settings gracefully.
Returns¶
SubscribeToTopics_WithNullSettings_ThrowsException()¶
Tests that SubscribeToTopics handles null topic settings gracefully.
Returns¶
SubscribeToTopics_WithValidSettings_RetrievesSettingsAndConnects()¶
Tests that SubscribeToTopics retrieves topic settings and establishes connection.