Skip to content

SearchServiceTests

Namespace: SlottyMedia.Tests.ServiceTests

Tests the SearchService used for searching for users and topics in the database.

public class SearchServiceTests

Inheritance ObjectSearchServiceTests

Constructors

SearchServiceTests()

public SearchServiceTests()

Methods

Setup()

The setup method that is called before each test.

public void Setup()

TearDown()

The teardown method that is called after each test.

public void TearDown()

SearchByUsername_ShouldReturnUserIds_WhenUsersFound()

Tests if SearchByUsername method returns user IDs when users are found.

public Task SearchByUsername_ShouldReturnUserIds_WhenUsersFound()

Returns

Task

SearchByTopic_ShouldReturnTopicIds_WhenTopicsFound()

Tests if SearchByTopic method returns topic IDs when topics are found.

public Task SearchByTopic_ShouldReturnTopicIds_WhenTopicsFound()

Returns

Task

SearchByUsernameOrTopic_ShouldReturnEmptyList_WhenNoResultsFound()

Tests if SearchByUsername and SearchByTopic methods return an empty list when no results are found.

public Task SearchByUsernameOrTopic_ShouldReturnEmptyList_WhenNoResultsFound()

Returns

Task

SearchByUsernameOrTopic_ShouldThrowException_WhenDatabaseThrowsException()

Tests if SearchByUsername and SearchByTopic methods throw SearchGeneralExceptions when a general database exception is thrown.

public void SearchByUsernameOrTopic_ShouldThrowException_WhenDatabaseThrowsException()

SearchByUsernameOrTopic_ShouldThrowSearchGeneralExceptions_WhenDatabaseMissingItemExceptionIsThrown()

Tests if SearchByUsername and SearchByTopic methods throw SearchGeneralExceptions when DatabaseMissingItemException is thrown.

public void SearchByUsernameOrTopic_ShouldThrowSearchGeneralExceptions_WhenDatabaseMissingItemExceptionIsThrown()

SearchByUsernameOrTopic_ShouldThrowSearchGeneralExceptions_WhenDatabaseExceptionIsThrown()

Tests if SearchByUsername and SearchByTopic methods throw SearchGeneralExceptions when GeneralDatabaseException is thrown.

public void SearchByUsernameOrTopic_ShouldThrowSearchGeneralExceptions_WhenDatabaseExceptionIsThrown()

SearchByUsername_ShouldReturnEmptyList_WhenSearchTermIsEmpty()

Tests if SearchByUsername and SearchByTopic methods return an empty list when the search term is empty.

public Task SearchByUsername_ShouldReturnEmptyList_WhenSearchTermIsEmpty()

Returns

Task

SearchByTopic_ShouldReturnEmptyList_WhenSearchTermIsEmpty()

Tests if SearchByUsername and SearchByTopic methods return an empty list when the search term is empty.

public Task SearchByTopic_ShouldReturnEmptyList_WhenSearchTermIsEmpty()

Returns

Task

SearchByUsername_ShouldHandleSpecialCharacters()

Tests if SearchByUsername and SearchByTopic methods return an empty list when the search term is null.

public Task SearchByUsername_ShouldHandleSpecialCharacters()

Returns

Task

SearchByTopic_ShouldHandleSpecialCharacters()

Tests if SearchByUsername and SearchByTopic methods return an empty list when the search term is null.

public Task SearchByTopic_ShouldHandleSpecialCharacters()

Returns

Task