SearchServiceTests
Namespace: SlottyMedia.Tests.ServiceTests
Tests the SearchService used for searching for users and topics in the database.
public class SearchServiceTests
Inheritance Object → SearchServiceTests
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
SearchByTopic_ShouldReturnTopicIds_WhenTopicsFound()
Tests if SearchByTopic method returns topic IDs when topics are found.
public Task SearchByTopic_ShouldReturnTopicIds_WhenTopicsFound()
Returns
SearchByUsernameOrTopic_ShouldReturnEmptyList_WhenNoResultsFound()
Tests if SearchByUsername and SearchByTopic methods return an empty list when no results are found.
public Task SearchByUsernameOrTopic_ShouldReturnEmptyList_WhenNoResultsFound()
Returns
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
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
SearchByUsername_ShouldHandleSpecialCharacters()
Tests if SearchByUsername and SearchByTopic methods return an empty list when the search term is null.
public Task SearchByUsername_ShouldHandleSpecialCharacters()
Returns
SearchByTopic_ShouldHandleSpecialCharacters()
Tests if SearchByUsername and SearchByTopic methods return an empty list when the search term is null.
public Task SearchByTopic_ShouldHandleSpecialCharacters()