Skip to content

Commit

Permalink
CODE RUB: StudentRegistration RetrieveById
Browse files Browse the repository at this point in the history
  • Loading branch information
glhays committed Jul 22, 2023
1 parent 4e454a0 commit 946187d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace OtripleS.Web.Api.Tests.Unit.Services.Foundations.StudentRegistrations
public partial class StudentRegistrationServiceTests
{
[Fact]
public async Task ShouldThrowDependencyExceptionOnRetrieveWhenSqlExceptionOccursAndLogItAsync()
public async Task ShouldThrowDependencyExceptionOnRetrieveByIdWhenSqlExceptionOccursAndLogItAsync()
{
// given
Guid someStudentId = Guid.NewGuid();
Expand Down Expand Up @@ -54,7 +54,7 @@ await Assert.ThrowsAsync<StudentRegistrationDependencyException>(() =>
}

[Fact]
public async Task ShouldThrowDependencyExceptionOnRetrieveWhenDbExceptionOccursAndLogItAsync()
public async Task ShouldThrowDependencyExceptionOnRetrieveByIdWhenDbExceptionOccursAndLogItAsync()
{
// given
Guid someStudentId = Guid.NewGuid();
Expand All @@ -70,7 +70,8 @@ public async Task ShouldThrowDependencyExceptionOnRetrieveWhenDbExceptionOccursA

// when
ValueTask<StudentRegistration> retrieveStudentRegistrationByIdTask =
this.studentRegistrationService.RetrieveStudentRegistrationByIdAsync(someStudentId, someRegistrationId);
this.studentRegistrationService.RetrieveStudentRegistrationByIdAsync(
someStudentId, someRegistrationId);

// then
await Assert.ThrowsAsync<StudentRegistrationDependencyException>(() =>
Expand All @@ -90,7 +91,7 @@ await Assert.ThrowsAsync<StudentRegistrationDependencyException>(() =>
}

[Fact]
public async Task ShouldThrowServiceExceptionOnRetrieveWhenExceptionOccursAndLogItAsync()
public async Task ShouldThrowServiceExceptionOnRetrieveByIdWhenExceptionOccursAndLogItAsync()
{
// given
Guid someStudentId = Guid.NewGuid();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace OtripleS.Web.Api.Tests.Unit.Services.Foundations.StudentRegistrations
public partial class StudentRegistrationServiceTests
{
[Fact]
public async void ShouldThrowValidationExceptionOnRetrieveWhenIdIsInvalidAndLogItAsync()
public async void ShouldThrowValidationExceptionOnRetrieveByIdWhenIdIsInvalidAndLogItAsync()
{
// given
Guid randomStudentId = default;
Expand Down Expand Up @@ -51,7 +51,7 @@ await Assert.ThrowsAsync<StudentRegistrationValidationException>(() =>
}

[Fact]
public async void ShouldThrowValidationExceptionOnRetrieveWhenStorageStudentRegistrationIsNullAndLogItAsync()
public async void ShouldThrowValidationExceptionOnRetrieveByIdWhenStudentRegistrationIsNullAndLogItAsync()
{
// given
Guid randomStudentId = Guid.NewGuid();
Expand Down

0 comments on commit 946187d

Please sign in to comment.