Skip to content

LikeServiceTests

Namespace: SlottyMedia.Tests.ServiceTests

Unit tests for the LikeService class.

public class LikeServiceTests

Inheritance ObjectLikeServiceTests

Constructors

LikeServiceTests()

public LikeServiceTests()

Methods

Setup()

Sets up the test environment before each test.

public void Setup()

TearDown()

Cleans up the test environment after each test.

public void TearDown()

InsertLike_ShouldReturnTrue_WhenLikeIsInsertedSuccessfully()

Tests that a like is inserted successfully.

public Task InsertLike_ShouldReturnTrue_WhenLikeIsInsertedSuccessfully()

Returns

Task

InsertLike_ShouldThrowLikeIudException_WhenDatabaseIudActionExceptionIsThrown()

Tests that a LikeIudException is thrown when a DatabaseIudActionException is thrown.

public void InsertLike_ShouldThrowLikeIudException_WhenDatabaseIudActionExceptionIsThrown()

InsertLike_ShouldThrowLikeGeneralException_WhenGeneralDatabaseExceptionIsThrown()

Tests that a LikeGeneralException is thrown when a GeneralDatabaseException is thrown.

public void InsertLike_ShouldThrowLikeGeneralException_WhenGeneralDatabaseExceptionIsThrown()

DeleteLike_ShouldReturnTrue_WhenLikeIsDeletedSuccessfully()

Tests that a like is deleted successfully.

public Task DeleteLike_ShouldReturnTrue_WhenLikeIsDeletedSuccessfully()

Returns

Task

DeleteLike_ShouldThrowLikeIudException_WhenDatabaseIudActionExceptionIsThrown()

Tests that a LikeIudException is thrown when a DatabaseIudActionException is thrown.

public void DeleteLike_ShouldThrowLikeIudException_WhenDatabaseIudActionExceptionIsThrown()

DeleteLike_ShouldThrowLikeGeneralException_WhenGeneralDatabaseExceptionIsThrown()

Tests that a LikeGeneralException is thrown when a GeneralDatabaseException is thrown.

public void DeleteLike_ShouldThrowLikeGeneralException_WhenGeneralDatabaseExceptionIsThrown()

GetLikesForPost_ShouldReturnUserIds_WhenLikesAreFound()

Tests that user IDs are returned when likes are found for a post.

public Task GetLikesForPost_ShouldReturnUserIds_WhenLikesAreFound()

Returns

Task

GetLikesForPost_ShouldThrowLikeNotFoundException_WhenDatabaseMissingItemExceptionIsThrown()

Tests that a LikeNotFoundException is thrown when a DatabaseMissingItemException is thrown.

public void GetLikesForPost_ShouldThrowLikeNotFoundException_WhenDatabaseMissingItemExceptionIsThrown()

GetLikesForPost_ShouldThrowLikeGeneralException_WhenGeneralDatabaseExceptionIsThrown()

Tests that a LikeGeneralException is thrown when a GeneralDatabaseException is thrown.

public void GetLikesForPost_ShouldThrowLikeGeneralException_WhenGeneralDatabaseExceptionIsThrown()

InsertLike_ShouldThrowLikeGeneralException_WhenGeneralExceptionIsThrown()

Tests that a LikeGeneralException is thrown when a general exception is thrown in InsertLike.

public void InsertLike_ShouldThrowLikeGeneralException_WhenGeneralExceptionIsThrown()

DeleteLike_ShouldThrowLikeNotFoundException_WhenDatabaseMissingItemExceptionIsThrown()

Tests that a LikeNotFoundException is thrown when a DatabaseMissingItemException is thrown in DeleteLike.

public void DeleteLike_ShouldThrowLikeNotFoundException_WhenDatabaseMissingItemExceptionIsThrown()

DeleteLike_ShouldThrowLikeGeneralException_WhenGeneralExceptionIsThrown()

Tests that a LikeGeneralException is thrown when a general exception is thrown in DeleteLike.

public void DeleteLike_ShouldThrowLikeGeneralException_WhenGeneralExceptionIsThrown()

GetLikesForPost_ShouldThrowLikeGeneralException_WhenGeneralExceptionIsThrown()

Tests that a LikeGeneralException is thrown when a general exception is thrown in GetLikesForPost.

public void GetLikesForPost_ShouldThrowLikeGeneralException_WhenGeneralExceptionIsThrown()