Skip to content

TopicControllerIntegrationTests

Namespace: IntegrationTests.Controllers

Integration tests for the Topic Controller to verify MQTT topic management and sensor configuration functionality.

public class TopicControllerIntegrationTests : IntegrationTests.Infrastructure.ApiClientTestBase

Inheritance ObjectIntegrationTestBaseApiClientTestBaseTopicControllerIntegrationTests

Constructors

TopicControllerIntegrationTests()

public TopicControllerIntegrationTests()

Methods

CreateTopic_WithAdminToken_AndValidData_ReturnsCreated()

Tests creating a new MQTT topic with admin privileges and valid data configuration.

public Task CreateTopic_WithAdminToken_AndValidData_ReturnsCreated()

Returns

Task

CreateTopic_WithInvalidData_ReturnsBadRequest()

Tests creating a topic with null data and verifies proper exception handling for invalid input.

public Task CreateTopic_WithInvalidData_ReturnsBadRequest()

Returns

Task

CreateTopic_WithoutToken_ReturnsUnauthorized()

Tests creating a topic without authentication token and verifies 401 Unauthorized response.

public void CreateTopic_WithoutToken_ReturnsUnauthorized()

CreateTopic_WithUserToken_ReturnsForbidden()

Tests creating a topic with user token and verifies 403 Forbidden response for insufficient privileges.

public Task CreateTopic_WithUserToken_ReturnsForbidden()

Returns

Task

GetAllSensorTypes_ReturnsOk()

Tests retrieving all sensor types and verifies successful response or proper error handling.

public Task GetAllSensorTypes_ReturnsOk()

Returns

Task

GetAllTopics_WithAdminToken_ReturnsOk()

Tests retrieving all topics with admin privileges and verifies successful response or proper error handling.

public Task GetAllTopics_WithAdminToken_ReturnsOk()

Returns

Task

GetAllTopics_WithoutToken_ReturnsUnauthorized()

Tests retrieving all topics without authentication token and verifies 401 Unauthorized response.

public void GetAllTopics_WithoutToken_ReturnsUnauthorized()

GetAllTopics_WithUserToken_ReturnsForbidden()

Tests retrieving all topics with user token and verifies 403 Forbidden response for insufficient privileges.

public Task GetAllTopics_WithUserToken_ReturnsForbidden()

Returns

Task

UpdateTopic_WithAdminToken_ReturnsOk()

Tests updating an existing MQTT topic with admin privileges and verifies successful modification.

public Task UpdateTopic_WithAdminToken_ReturnsOk()

Returns

Task

UpdateTopic_WithUserToken_ReturnsForbidden()

Tests updating a topic with user token and verifies 403 Forbidden response for insufficient privileges.

public Task UpdateTopic_WithUserToken_ReturnsForbidden()

Returns

Task