Skip to content

LocationControllerIntegrationTests

Namespace: IntegrationTests.Controllers

Integration tests for the Location Controller to verify postal code management and location-based functionality.

public class LocationControllerIntegrationTests : IntegrationTests.Infrastructure.ApiClientTestBase

Inheritance ObjectIntegrationTestBaseApiClientTestBaseLocationControllerIntegrationTests

Constructors

LocationControllerIntegrationTests()

public LocationControllerIntegrationTests()

Methods

GetAllPostalcodes_WithAdminToken_ReturnsOk()

Tests retrieving all postal codes with admin token and verifies successful response.

public Task GetAllPostalcodes_WithAdminToken_ReturnsOk()

Returns

Task

GetAllPostalcodes_WithoutToken_ThrowsUnauthorizedException()

Tests retrieving postal codes without authentication token and verifies 401 Unauthorized response.

public void GetAllPostalcodes_WithoutToken_ThrowsUnauthorizedException()

GetAllPostalcodes_WithValidUserToken_ReturnsOk()

Tests retrieving all postal codes with valid user token and verifies successful response.

public Task GetAllPostalcodes_WithValidUserToken_ReturnsOk()

Returns

Task

InsertLocation_WithAdminToken_ReturnsOk()

Tests inserting a new location with admin privileges and verifies successful operation.

public Task InsertLocation_WithAdminToken_ReturnsOk()

Returns

Task

InsertLocation_WithoutToken_ThrowsUnauthorizedException()

Tests inserting a location without authentication token and verifies 401 Unauthorized response.

public void InsertLocation_WithoutToken_ThrowsUnauthorizedException()

InsertLocation_WithUserToken_ThrowsForbiddenException()

Tests inserting a location with user token and verifies 403 Forbidden response for insufficient privileges.

public Task InsertLocation_WithUserToken_ThrowsForbiddenException()

Returns

Task

RemovePostalcode_WithoutToken_ThrowsUnauthorizedException()

Tests removing a postal code without authentication token and verifies 401 Unauthorized response.

public void RemovePostalcode_WithoutToken_ThrowsUnauthorizedException()

RemovePostalcode_WithValidToken_ReturnsOkOrNotFound()

Tests removing a postal code with valid authentication and verifies successful deletion or proper error handling.

public Task RemovePostalcode_WithValidToken_ReturnsOkOrNotFound()

Returns

Task