Skip to content

CommentServiceTests

Namespace: SlottyMedia.Tests.ServiceTests

Unit tests for the CommentService class.

public class CommentServiceTests

Inheritance ObjectCommentServiceTests

Constructors

CommentServiceTests()

public CommentServiceTests()

Methods

Setup()

Initializes the mock objects and the CommentService instance before each test.

public void Setup()

TearDown()

Resets the mock objects after each test.

public void TearDown()

InsertComment_ShouldInsertComment_WhenCommentIsValid()

Tests that InsertComment method inserts a comment when the comment is valid.

public Task InsertComment_ShouldInsertComment_WhenCommentIsValid()

Returns

Task

InsertComment_ShouldThrowCommentIudException_WhenDatabaseIudActionExceptionIsThrown()

Tests that InsertComment method throws CommentIudException when DatabaseIudActionException is thrown.

public void InsertComment_ShouldThrowCommentIudException_WhenDatabaseIudActionExceptionIsThrown()

InsertComment_ShouldThrowCommentGeneralException_WhenGeneralDatabaseExceptionIsThrown()

Tests that InsertComment method throws CommentGeneralException when GeneralDatabaseException is thrown.

public void InsertComment_ShouldThrowCommentGeneralException_WhenGeneralDatabaseExceptionIsThrown()

UpdateComment_ShouldUpdateComment_WhenCommentIsValid()

Tests that UpdateComment method updates a comment when the comment is valid.

public Task UpdateComment_ShouldUpdateComment_WhenCommentIsValid()

Returns

Task

UpdateComment_ShouldThrowCommentIudException_WhenDatabaseIudActionExceptionIsThrown()

Tests that UpdateComment method throws CommentIudException when DatabaseIudActionException is thrown.

public void UpdateComment_ShouldThrowCommentIudException_WhenDatabaseIudActionExceptionIsThrown()

UpdateComment_ShouldThrowCommentGeneralException_WhenGeneralDatabaseExceptionIsThrown()

Tests that UpdateComment method throws CommentGeneralException when GeneralDatabaseException is thrown.

public void UpdateComment_ShouldThrowCommentGeneralException_WhenGeneralDatabaseExceptionIsThrown()

DeleteComment_ShouldDeleteComment_WhenCommentIsValid()

Tests that DeleteComment method deletes a comment when the comment is valid.

public Task DeleteComment_ShouldDeleteComment_WhenCommentIsValid()

Returns

Task

DeleteComment_ShouldThrowCommentIudException_WhenDatabaseIudActionExceptionIsThrown()

Tests that DeleteComment method throws CommentIudException when DatabaseIudActionException is thrown.

public void DeleteComment_ShouldThrowCommentIudException_WhenDatabaseIudActionExceptionIsThrown()

DeleteComment_ShouldThrowCommentGeneralException_WhenGeneralDatabaseExceptionIsThrown()

Tests that DeleteComment method throws CommentGeneralException when GeneralDatabaseException is thrown.

public void DeleteComment_ShouldThrowCommentGeneralException_WhenGeneralDatabaseExceptionIsThrown()

InsertComment_ShouldThrowCommentGeneralException_WhenExceptionIsThrown()

Tests that InsertComment method throws CommentGeneralException when a general exception is thrown.

public void InsertComment_ShouldThrowCommentGeneralException_WhenExceptionIsThrown()

UpdateComment_ShouldThrowCommentGeneralException_WhenExceptionIsThrown()

Tests that UpdateComment method throws CommentGeneralException when a general exception is thrown.

public void UpdateComment_ShouldThrowCommentGeneralException_WhenExceptionIsThrown()

DeleteComment_ShouldThrowCommentGeneralException_WhenExceptionIsThrown()

Tests that DeleteComment method throws CommentGeneralException when a general exception is thrown.

public void DeleteComment_ShouldThrowCommentGeneralException_WhenExceptionIsThrown()