rama creada apartir de master en j
This commit is contained in:
@@ -16,6 +16,11 @@ namespace adas_core.Test.Services;
|
||||
[TestFixture]
|
||||
public class MasterListServiceTest
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes all required mock dependencies and constructs a <see cref="MasterListService{MasterList}"/> instance
|
||||
/// for use in unit tests. Configures the HTTP context with a test user principal, registers the master list repository
|
||||
/// in the service provider, and supplies default API settings.
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
@@ -83,6 +88,9 @@ public class MasterListServiceTest
|
||||
private MasterListService<MasterList> _service = null!;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that <c>DeleteMasterListById</c> invokes the repository's <c>Delete</c> method once with the provided identifier when the master list is found.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task DeleteMasterListById_ShouldCallRepositoryDelete_WhenMasterListFound()
|
||||
{
|
||||
@@ -117,6 +125,9 @@ public class MasterListServiceTest
|
||||
// Assert.That(masterLists, Is.EqualTo(result));
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that the service returns the master list when it is found by the specified id.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task GetMasterListById_ShouldReturnMasterList_WhenFound()
|
||||
{
|
||||
@@ -133,6 +144,9 @@ public class MasterListServiceTest
|
||||
Assert.That(masterList, Is.EqualTo(result));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that <c>GetMasterListByName</c> returns the matching <see cref="MasterList"/> when a master list with the specified name is found in the repository.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task GetMasterListByName_ShouldReturnMasterList_WhenFound()
|
||||
{
|
||||
@@ -149,6 +163,9 @@ public class MasterListServiceTest
|
||||
Assert.That(masterList, Is.EqualTo(result));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that the InsertMasterList service method returns the same <see cref="MasterList"/> instance that was inserted, ensuring the service correctly retrieves the inserted entity by its identifier after persistence.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task InsertMasterList_ShouldReturnInsertedMasterList()
|
||||
{
|
||||
@@ -166,6 +183,10 @@ public class MasterListServiceTest
|
||||
Assert.That(masterList, Is.EqualTo(result));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that UpdateMasterList returns the updated master list when the repository successfully completes the update and finds the entity by id.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="Task"/> representing the asynchronous test execution.</returns>
|
||||
[Test]
|
||||
public async Task UpdateMasterList_ShouldReturnUpdatedMasterList()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user