ForumServiceTests
Namespace: SlottyMedia.Tests.ServiceTests
Unit tests for the ForumService class.
public class ForumServiceTests
Inheritance Object → ForumServiceTests
Constructors
ForumServiceTests()
public ForumServiceTests()
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()
InsertForum_ShouldInsertForum_WhenForumIsValid()
Tests that a forum is inserted when the forum is valid.
public Task InsertForum_ShouldInsertForum_WhenForumIsValid()
Returns
InsertForum_ShouldThrowForumIudException_WhenDatabaseIudActionExceptionIsThrown()
Tests that a ForumIudException is thrown when a DatabaseIudActionException is thrown.
public void InsertForum_ShouldThrowForumIudException_WhenDatabaseIudActionExceptionIsThrown()
InsertForum_ShouldThrowForumGeneralException_WhenGeneralDatabaseExceptionIsThrown()
Tests that a ForumGeneralException is thrown when a GeneralDatabaseException is thrown.
public void InsertForum_ShouldThrowForumGeneralException_WhenGeneralDatabaseExceptionIsThrown()
DeleteForum_ShouldDeleteForum_WhenForumIsValid()
Tests that a forum is deleted when the forum is valid.
public Task DeleteForum_ShouldDeleteForum_WhenForumIsValid()
Returns
DeleteForum_ShouldThrowForumIudException_WhenDatabaseIudActionExceptionIsThrown()
Tests that a ForumIudException is thrown when a DatabaseIudActionException is thrown.
public void DeleteForum_ShouldThrowForumIudException_WhenDatabaseIudActionExceptionIsThrown()
DeleteForum_ShouldThrowForumGeneralException_WhenGeneralDatabaseExceptionIsThrown()
Tests that a ForumGeneralException is thrown when a GeneralDatabaseException is thrown.
public void DeleteForum_ShouldThrowForumGeneralException_WhenGeneralDatabaseExceptionIsThrown()
GetForumByName_ShouldReturnForum_WhenForumExists()
Tests that a forum is returned when the forum exists.
public Task GetForumByName_ShouldReturnForum_WhenForumExists()
Returns
GetForumByName_ShouldThrowForumGeneralException_WhenDatabaseMissingItemExceptionIsThrown()
Tests that a ForumNotFoundException is thrown when a DatabaseMissingItemException is thrown.
public void GetForumByName_ShouldThrowForumGeneralException_WhenDatabaseMissingItemExceptionIsThrown()
DetermineRecentSpaces_ShouldReturnRecentForums_WhenForumsExist()
Tests that recent forums are returned when forums exist.
public Task DetermineRecentSpaces_ShouldReturnRecentForums_WhenForumsExist()
Returns
DetermineRecentSpaces_ShouldThrowForumGeneralException_WhenDatabaseMissingItemExceptionIsThrown()
Tests that a ForumNotFoundException is thrown when a DatabaseMissingItemException is thrown.
public void DetermineRecentSpaces_ShouldThrowForumGeneralException_WhenDatabaseMissingItemExceptionIsThrown()
GetTopForums_ShouldReturnTopForums_WhenForumsExist()
Tests that top forums are returned when forums exist.
public Task GetTopForums_ShouldReturnTopForums_WhenForumsExist()
Returns
GetTopForums_ShouldThrowForumGeneralException_WhenDatabaseMissingItemExceptionIsThrown()
Tests that a ForumNotFoundException is thrown when a DatabaseMissingItemException is thrown.
public void GetTopForums_ShouldThrowForumGeneralException_WhenDatabaseMissingItemExceptionIsThrown()
InsertForum_ShouldThrowForumGeneralException_WhenGeneralExceptionIsThrown()
Tests that a ForumGeneralException is thrown when a general exception is thrown during forum insertion.
public void InsertForum_ShouldThrowForumGeneralException_WhenGeneralExceptionIsThrown()
DeleteForum_ShouldThrowForumGeneralException_WhenGeneralExceptionIsThrown()
Tests that a ForumGeneralException is thrown when a general exception is thrown during forum deletion.
public void DeleteForum_ShouldThrowForumGeneralException_WhenGeneralExceptionIsThrown()
GetForumByName_ShouldThrowForumGeneralException_WhenGeneralExceptionIsThrown()
Tests that a ForumGeneralException is thrown when a general exception is thrown during forum retrieval by name.
public void GetForumByName_ShouldThrowForumGeneralException_WhenGeneralExceptionIsThrown()
DetermineRecentSpaces_ShouldThrowForumGeneralException_WhenGeneralExceptionIsThrown()
Tests that a ForumGeneralException is thrown when a general exception is thrown during retrieval of recent forums.
public void DetermineRecentSpaces_ShouldThrowForumGeneralException_WhenGeneralExceptionIsThrown()
GetTopForums_ShouldThrowForumGeneralException_WhenGeneralExceptionIsThrown()
Tests that a ForumGeneralException is thrown when a general exception is thrown during retrieval of top forums.
public void GetTopForums_ShouldThrowForumGeneralException_WhenGeneralExceptionIsThrown()