diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exception.RemoveById.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exception.RemoveById.cs index 7d067837..1cf457cb 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exception.RemoveById.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exception.RemoveById.cs @@ -18,7 +18,7 @@ namespace Taarafo.Core.Tests.Unit.Services.Foundations.GroupPosts public partial class GroupPostServiceTests { [Fact] - public async Task ShouldThrowDependencyValidationOnRemoveIfDatabaseUpdateConcurrencyErrorOccursAndLogItAsync() + private async Task ShouldThrowDependencyValidationOnRemoveIfDatabaseUpdateConcurrencyErrorOccursAndLogItAsync() { // given Guid groupId = Guid.NewGuid(); @@ -27,10 +27,14 @@ public async Task ShouldThrowDependencyValidationOnRemoveIfDatabaseUpdateConcurr var databaseUpdateConcurrencyException = new DbUpdateConcurrencyException(); var lockedGroupPostException = - new LockedGroupPostException(databaseUpdateConcurrencyException); + new LockedGroupPostException( + message: "GroupPost is locked, please try again.", + innerException: databaseUpdateConcurrencyException); var expectedGroupPostDependencyValidationException = - new GroupPostDependencyValidationException(lockedGroupPostException); + new GroupPostDependencyValidationException( + message: "Group post dependency validation occurred, please try again.", + innerException: lockedGroupPostException); this.storageBrokerMock.Setup(broker => broker.SelectGroupPostByIdAsync(It.IsAny(), It.IsAny())) @@ -66,7 +70,7 @@ await Assert.ThrowsAsync( } [Fact] - public async Task ShouldThrowDependencyExceptionOnDeleteWhenSqlExceptionOccursAndLogItAsync() + private async Task ShouldThrowDependencyExceptionOnDeleteWhenSqlExceptionOccursAndLogItAsync() { // given Guid groupId = Guid.NewGuid(); @@ -74,10 +78,14 @@ public async Task ShouldThrowDependencyExceptionOnDeleteWhenSqlExceptionOccursAn SqlException sqlException = GetSqlException(); var failedGroupPostStorageException = - new FailedGroupPostStorageException(sqlException); + new FailedGroupPostStorageException( + message: "Failed group post storage error occured, contact support.", + innerException: sqlException); var expectedGroupPostDependencyException = - new GroupPostDependencyException(failedGroupPostStorageException); + new GroupPostDependencyException( + message: "Group post dependency validation occurred, please try again.", + innerException: failedGroupPostStorageException); this.storageBrokerMock.Setup(broker => broker.SelectGroupPostByIdAsync(It.IsAny(), It.IsAny())) @@ -109,7 +117,7 @@ await Assert.ThrowsAsync( } [Fact] - public async Task ShouldThrowServiceExceptionOnRemoveIfExceptionOccursAndLogItAsync() + private async Task ShouldThrowServiceExceptionOnRemoveIfExceptionOccursAndLogItAsync() { // given Guid groupId = Guid.NewGuid(); @@ -117,10 +125,14 @@ public async Task ShouldThrowServiceExceptionOnRemoveIfExceptionOccursAndLogItAs var serviceException = new Exception(); var failedGroupPostServiceException = - new FailedGroupPostServiceException(serviceException); + new FailedGroupPostServiceException( + message: "Failed group post service occurred, please contact support.", + innerException: serviceException); var expectedGroupPostServiceException = - new GroupPostServiceException(failedGroupPostServiceException); + new GroupPostServiceException( + message: "Group post service error occurred, please contact support.", + innerException: failedGroupPostServiceException); this.storageBrokerMock.Setup(broker => broker.SelectGroupPostByIdAsync(It.IsAny(), It.IsAny())) @@ -151,4 +163,4 @@ await Assert.ThrowsAsync( this.loggingBrokerMock.VerifyNoOtherCalls(); } } -} +} \ No newline at end of file diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.Add.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.Add.cs index e7656920..38f908b6 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.Add.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.Add.cs @@ -19,17 +19,21 @@ namespace Taarafo.Core.Tests.Unit.Services.Foundations.GroupPosts public partial class GroupPostServiceTests { [Fact] - public async Task ShouldThrowCriticalDependencyExceptionOnAddIfSqlErrorOccursAndLogItAsync() + private async Task ShouldThrowCriticalDependencyExceptionOnAddIfSqlErrorOccursAndLogItAsync() { // given GroupPost someGroupPost = CreateRandomGroupPost(); SqlException sqlException = GetSqlException(); var failedGroupPostStorageException = - new FailedGroupPostStorageException(sqlException); + new FailedGroupPostStorageException( + message: "Failed group post storage error occured, contact support.", + innerException: sqlException); var expectedGroupPostDependencyException = - new GroupPostDependencyException(failedGroupPostStorageException); + new GroupPostDependencyException( + message: "Group post dependency validation occurred, please try again.", + innerException: failedGroupPostStorageException); this.storageBrokerMock.Setup(broker => broker.InsertGroupPostAsync(It.IsAny())) @@ -57,7 +61,7 @@ await Assert.ThrowsAsync(() => } [Fact] - public async Task ShouldThrowDependencyValidationExceptionOnAddIfGroupPostAlreadyExistsAndLogItAsync() + private async Task ShouldThrowDependencyValidationExceptionOnAddIfGroupPostAlreadyExistsAndLogItAsync() { // given GroupPost someGroupPost = CreateRandomGroupPost(); @@ -67,10 +71,14 @@ public async Task ShouldThrowDependencyValidationExceptionOnAddIfGroupPostAlread new DuplicateKeyException(randomMessage); var alreadyExistsGroupPostException = - new AlreadyExistsGroupPostException(duplicateKeyException); + new AlreadyExistsGroupPostException( + message: "Group post with the same id already exists.", + innerException: duplicateKeyException); var expectedGroupPostDependencyValidationException = - new GroupPostDependencyValidationException(alreadyExistsGroupPostException); + new GroupPostDependencyValidationException( + message: "Group post dependency validation occurred, please try again.", + innerException: alreadyExistsGroupPostException); this.storageBrokerMock.Setup(broker => broker.InsertGroupPostAsync(It.IsAny())) @@ -102,7 +110,7 @@ await Assert.ThrowsAsync( } [Fact] - public async Task ShouldThrowDependencyExceptionOnAddIfDatabaseUpdateErrorOccursAndLogItAsync() + private async Task ShouldThrowDependencyExceptionOnAddIfDatabaseUpdateErrorOccursAndLogItAsync() { //given GroupPost someGroupPost = CreateRandomGroupPost(); @@ -111,10 +119,14 @@ public async Task ShouldThrowDependencyExceptionOnAddIfDatabaseUpdateErrorOccurs new DbUpdateException(); var failedGroupPostStorageException = - new FailedGroupPostStorageException(databaseUpdateException); + new FailedGroupPostStorageException( + message: "Failed group post storage error occured, contact support.", + innerException: databaseUpdateException); var expectedGroupPostDependencyException = - new GroupPostDependencyException(failedGroupPostStorageException); + new GroupPostDependencyException( + message: "Group post dependency validation occurred, please try again.", + innerException: failedGroupPostStorageException); this.storageBrokerMock.Setup(broker => broker.InsertGroupPostAsync(someGroupPost)) @@ -146,7 +158,7 @@ await Assert.ThrowsAsync( } [Fact] - public async void ShouldThrowDependencyValidationExceptionOnAddIfReferenceErrorOccursAndLogItAsync() + private async void ShouldThrowDependencyValidationExceptionOnAddIfReferenceErrorOccursAndLogItAsync() { //given GroupPost someGroupPost = CreateRandomGroupPost(); @@ -157,10 +169,14 @@ public async void ShouldThrowDependencyValidationExceptionOnAddIfReferenceErrorO new ForeignKeyConstraintConflictException(exceptionMessage); var invalidGroupPostReferenceException = - new InvalidGroupPostReferenceException(foreignKeyConstraintConflictException); + new InvalidGroupPostReferenceException( + message: "Invalid group post reference error occurred.", + innerException: foreignKeyConstraintConflictException); var expectedGroupPostDependencyValidationException = - new GroupPostDependencyValidationException(invalidGroupPostReferenceException); + new GroupPostDependencyValidationException( + message: "Group post dependency validation occurred, please try again.", + innerException: invalidGroupPostReferenceException); this.storageBrokerMock.Setup(broker => broker.InsertGroupPostAsync(someGroupPost)) @@ -192,17 +208,21 @@ await Assert.ThrowsAsync( } [Fact] - public async Task ShouldThrowServiceExceptionOnAddIfServiceErrorOccursAndLogItAsync() + private async Task ShouldThrowServiceExceptionOnAddIfServiceErrorOccursAndLogItAsync() { //given GroupPost someGroupPost = CreateRandomGroupPost(); var serviceException = new Exception(); var failedGroupPostServiceException = - new FailedGroupPostServiceException(serviceException); + new FailedGroupPostServiceException( + message: "Failed group post service occurred, please contact support.", + innerException: serviceException); var expectedGroupPostServiceException = - new GroupPostServiceException(failedGroupPostServiceException); + new GroupPostServiceException( + message: "Group post service error occurred, please contact support.", + innerException: failedGroupPostServiceException); this.storageBrokerMock.Setup(broker => broker.InsertGroupPostAsync(someGroupPost)) @@ -233,4 +253,4 @@ await Assert.ThrowsAsync( this.loggingBrokerMock.VerifyNoOtherCalls(); } } -} +} \ No newline at end of file diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.Modify.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.Modify.cs index c9220927..d3cedc50 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.Modify.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.Modify.cs @@ -18,7 +18,7 @@ namespace Taarafo.Core.Tests.Unit.Services.Foundations.GroupPosts public partial class GroupPostServiceTests { [Fact] - public async Task ShouldThrowCriticalDependencyExceptionOnModifyIfSqlErrorOccursAndLogItAsync() + private async Task ShouldThrowCriticalDependencyExceptionOnModifyIfSqlErrorOccursAndLogItAsync() { // given DateTimeOffset someDateTime = GetRandomDateTimeOffset(); @@ -29,10 +29,14 @@ public async Task ShouldThrowCriticalDependencyExceptionOnModifyIfSqlErrorOccurs SqlException sqlException = CreateSqlException(); var failedGroupPostStorageException = - new FailedGroupPostStorageException(sqlException); + new FailedGroupPostStorageException( + message: "Failed group post storage error occured, contact support.", + innerException: sqlException); var expectedGroupPostDependencyException = - new GroupPostDependencyException(failedGroupPostStorageException); + new GroupPostDependencyException( + message: "Group post dependency validation occurred, please try again.", + innerException: failedGroupPostStorageException); this.storageBrokerMock.Setup(broker => broker.SelectGroupPostByIdAsync(groupId, postId)) @@ -65,7 +69,7 @@ await Assert.ThrowsAsync( } [Fact] - public async Task ShouldThrowDependencyExceptionOnModifyIfDatabaseUpdateExceptionOccursAndLogItAsync() + private async Task ShouldThrowDependencyExceptionOnModifyIfDatabaseUpdateExceptionOccursAndLogItAsync() { // given int minutesInPast = GetRandomNegativeNumber(); @@ -77,10 +81,14 @@ public async Task ShouldThrowDependencyExceptionOnModifyIfDatabaseUpdateExceptio var databaseUpdateException = new DbUpdateException(); var failedGroupPostException = - new FailedGroupPostStorageException(databaseUpdateException); + new FailedGroupPostStorageException( + message: "Failed group post storage error occured, contact support.", + innerException: databaseUpdateException); var expectedGroupPostDependencyException = - new GroupPostDependencyException(failedGroupPostException); + new GroupPostDependencyException( + message: "Group post dependency validation occurred, please try again.", + innerException: failedGroupPostException); this.storageBrokerMock.Setup(broker => broker.SelectGroupPostByIdAsync(groupId, postId)) @@ -110,7 +118,7 @@ await Assert.ThrowsAsync( } [Fact] - public async Task ShouldThrowDependencyValidationExceptionOnModifyIfDatabaseUpdateConcurrencyErrorOccursAndLogItAsync() + private async Task ShouldThrowDependencyValidationExceptionOnModifyIfDatabaseUpdateConcurrencyErrorOccursAndLogItAsync() { // given int minutesInPast = GetRandomNegativeNumber(); @@ -122,10 +130,14 @@ public async Task ShouldThrowDependencyValidationExceptionOnModifyIfDatabaseUpda var databaseUpdateConcurrencyException = new DbUpdateConcurrencyException(); var lockedGroupPostException = - new LockedGroupPostException(databaseUpdateConcurrencyException); + new LockedGroupPostException( + message: "GroupPost is locked, please try again.", + innerException: databaseUpdateConcurrencyException); var expectedGroupPostDependencyValidationException = - new GroupPostDependencyValidationException(lockedGroupPostException); + new GroupPostDependencyValidationException( + message: "Group post dependency validation occurred, please try again.", + innerException: lockedGroupPostException); this.storageBrokerMock.Setup(broker => broker.SelectGroupPostByIdAsync(groupId, postId)) @@ -154,7 +166,7 @@ await Assert.ThrowsAsync( } [Fact] - public async Task ShouldThrowServiceExceptionOnModifyIfDatabaseUpdateErrorOccursAndLogItAsync() + private async Task ShouldThrowServiceExceptionOnModifyIfDatabaseUpdateErrorOccursAndLogItAsync() { // given int minuteInPast = GetRandomNegativeNumber(); @@ -164,10 +176,14 @@ public async Task ShouldThrowServiceExceptionOnModifyIfDatabaseUpdateErrorOccurs var serviceException = new Exception(); var failedGroupPostException = - new FailedGroupPostServiceException(serviceException); + new FailedGroupPostServiceException( + message: "Failed group post service occurred, please contact support.", + innerException: serviceException); var expectedGroupPostServiceException = - new GroupPostServiceException(failedGroupPostException); + new GroupPostServiceException( + message: "Group post service error occurred, please contact support.", + innerException: failedGroupPostException); this.storageBrokerMock.Setup(broker => broker.SelectGroupPostByIdAsync(someGroupPost.GroupId, someGroupPost.PostId)) @@ -196,4 +212,4 @@ await Assert.ThrowsAsync( this.loggingBrokerMock.VerifyNoOtherCalls(); } } -} +} \ No newline at end of file diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.RetrieveAll.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.RetrieveAll.cs index 49cda81e..7ee2795d 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.RetrieveAll.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.RetrieveAll.cs @@ -15,16 +15,20 @@ namespace Taarafo.Core.Tests.Unit.Services.Foundations.GroupPosts public partial class GroupPostServiceTests { [Fact] - public void ShouldThrowCriticalDependencyExceptionOnRetrieveAllIfSqlErrorOccursAndLogIt() + private void ShouldThrowCriticalDependencyExceptionOnRetrieveAllIfSqlErrorOccursAndLogIt() { //given SqlException sqlException = GetSqlException(); var failedGroupPostStorageException = - new FailedGroupPostStorageException(sqlException); + new FailedGroupPostStorageException( + message: "Failed group post storage error occured, contact support.", + innerException: sqlException); var expectedGroupPostDependencyException = - new GroupPostDependencyException(failedGroupPostStorageException); + new GroupPostDependencyException( + message: "Group post dependency validation occurred, please try again.", + innerException: failedGroupPostStorageException); this.storageBrokerMock.Setup(broker => broker.SelectAllGroupPosts()).Throws(sqlException); @@ -52,17 +56,21 @@ public void ShouldThrowCriticalDependencyExceptionOnRetrieveAllIfSqlErrorOccursA } [Fact] - public void ShouldThrowServiceExceptionOnRetrieveAllWhenAllServiceErrorOccursAndLogIt() + private void ShouldThrowServiceExceptionOnRetrieveAllWhenAllServiceErrorOccursAndLogIt() { //given string exceptionMessage = GetRandomString(); var serviceException = new Exception(exceptionMessage); var failedGroupPostServiceException = - new FailedGroupPostServiceException(serviceException); + new FailedGroupPostServiceException( + message: "Failed group post service occurred, please contact support.", + innerException: serviceException); var expectedGroupPostServiceException = - new GroupPostServiceException(failedGroupPostServiceException); + new GroupPostServiceException( + message: "Group post service error occurred, please contact support.", + innerException: failedGroupPostServiceException); this.storageBrokerMock.Setup(broker => broker.SelectAllGroupPosts()).Throws(serviceException); @@ -88,4 +96,4 @@ public void ShouldThrowServiceExceptionOnRetrieveAllWhenAllServiceErrorOccursAnd this.loggingBrokerMock.VerifyNoOtherCalls(); } } -} +} \ No newline at end of file diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.RetrieveById.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.RetrieveById.cs index 1a6badf3..5cac0cf8 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.RetrieveById.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Exceptions.RetrieveById.cs @@ -17,7 +17,7 @@ namespace Taarafo.Core.Tests.Unit.Services.Foundations.GroupPosts public partial class GroupPostServiceTests { [Fact] - public async Task ShouldThrowCriticalDependencyExceptionOnRetrieveByIdIfSqlErrorOccursAndLogItAsync() + private async Task ShouldThrowCriticalDependencyExceptionOnRetrieveByIdIfSqlErrorOccursAndLogItAsync() { //given Guid someGroupId = Guid.NewGuid(); @@ -25,10 +25,14 @@ public async Task ShouldThrowCriticalDependencyExceptionOnRetrieveByIdIfSqlError SqlException sqlException = GetSqlException(); var failedGroupPostStorageException = - new FailedGroupPostStorageException(sqlException); + new FailedGroupPostStorageException( + message: "Failed group post storage error occured, contact support.", + innerException: sqlException); var expectedGroupPostDependencyException = - new GroupPostDependencyException(failedGroupPostStorageException); + new GroupPostDependencyException( + message: "Group post dependency validation occurred, please try again.", + innerException: failedGroupPostStorageException); this.storageBrokerMock.Setup(broker => broker.SelectGroupPostByIdAsync(someGroupId, somePostId)) @@ -61,7 +65,7 @@ await Assert.ThrowsAsync( } [Fact] - public async Task ShouldThrowServiceExceptionOnRetrieveByIdIfServiceErrorOccursAndLogItAsync() + private async Task ShouldThrowServiceExceptionOnRetrieveByIdIfServiceErrorOccursAndLogItAsync() { //given Guid someGroupId = Guid.NewGuid(); @@ -69,10 +73,14 @@ public async Task ShouldThrowServiceExceptionOnRetrieveByIdIfServiceErrorOccursA var serviceException = new Exception(); var failedGroupPostServiceException = - new FailedGroupPostServiceException(serviceException); + new FailedGroupPostServiceException( + message: "Failed group post service occurred, please contact support.", + innerException: serviceException); var expectedGroupPostServiceException = - new GroupPostServiceException(failedGroupPostServiceException); + new GroupPostServiceException( + message: "Group post service error occurred, please contact support.", + innerException: failedGroupPostServiceException); this.storageBrokerMock.Setup(broker => broker.SelectGroupPostByIdAsync(someGroupId, somePostId)) @@ -80,16 +88,20 @@ public async Task ShouldThrowServiceExceptionOnRetrieveByIdIfServiceErrorOccursA //when ValueTask retrieveGroupPostByIdTask = - this.groupPostService.RetrieveGroupPostByIdAsync(someGroupId, somePostId); + this.groupPostService.RetrieveGroupPostByIdAsync( + someGroupId, somePostId); GroupPostServiceException actualGroupPostServiceException = - await Assert.ThrowsAsync(retrieveGroupPostByIdTask.AsTask); + await Assert.ThrowsAsync( + retrieveGroupPostByIdTask.AsTask); //then - actualGroupPostServiceException.Should().BeEquivalentTo(expectedGroupPostServiceException); + actualGroupPostServiceException.Should().BeEquivalentTo( + expectedGroupPostServiceException); this.storageBrokerMock.Verify(broker => - broker.SelectGroupPostByIdAsync(It.IsAny(), (It.IsAny())), + broker.SelectGroupPostByIdAsync( + It.IsAny(), (It.IsAny())), Times.Once); this.loggingBrokerMock.Verify(broker => diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.Add.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.Add.cs index 3266dae7..610d2f66 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.Add.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.Add.cs @@ -15,7 +15,7 @@ namespace Taarafo.Core.Tests.Unit.Services.Foundations.GroupPosts public partial class GroupPostServiceTests { [Fact] - public async Task ShouldAddGroupPostAsync() + private async Task ShouldAddGroupPostAsync() { // given GroupPost randomGroupPost = CreateRandomGroupPost(); @@ -42,4 +42,4 @@ public async Task ShouldAddGroupPostAsync() this.loggingBrokerMock.VerifyNoOtherCalls(); } } -} +} \ No newline at end of file diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.Modify.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.Modify.cs index eb0cf235..44514b17 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.Modify.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.Modify.cs @@ -16,7 +16,7 @@ namespace Taarafo.Core.Tests.Unit.Services.Foundations.GroupPosts public partial class GroupPostServiceTests { [Fact] - public async Task ShouldModifyGroupPostAsync() + private async Task ShouldModifyGroupPostAsync() { //given DateTimeOffset randomDate = GetRandomDateTimeOffset(); @@ -48,7 +48,7 @@ public async Task ShouldModifyGroupPostAsync() this.storageBrokerMock.Verify(broker => broker.UpdateGroupPostAsync(inputGroupPost), Times.Once); - + this.storageBrokerMock.Verify(broker => broker.SelectGroupPostByIdAsync(groupId, postId), Times.Once); @@ -56,4 +56,4 @@ public async Task ShouldModifyGroupPostAsync() this.loggingBrokerMock.VerifyNoOtherCalls(); } } -} +} \ No newline at end of file diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.RemoveById.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.RemoveById.cs index d95720b8..1fc94ced 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.RemoveById.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.RemoveById.cs @@ -16,7 +16,7 @@ namespace Taarafo.Core.Tests.Unit.Services.Foundations.GroupPosts public partial class GroupPostServiceTests { [Fact] - public async Task ShouldRemoveGroupPostByIdAsync() + private async Task ShouldRemoveGroupPostByIdAsync() { // given Guid randomGroupId = Guid.NewGuid(); @@ -54,4 +54,4 @@ public async Task ShouldRemoveGroupPostByIdAsync() this.loggingBrokerMock.VerifyNoOtherCalls(); } } -} +} \ No newline at end of file diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.RetrieveAll.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.RetrieveAll.cs index 7677a8b0..fb942b89 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.RetrieveAll.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.RetrieveAll.cs @@ -14,21 +14,29 @@ namespace Taarafo.Core.Tests.Unit.Services.Foundations.GroupPosts public partial class GroupPostServiceTests { [Fact] - public void ShouldRetrieveAllGroupPosts() + private void ShouldRetrieveAllGroupPosts() { //given - IQueryable randomGroupPosts = CreateRandomGroupPosts(); - IQueryable storageGroupPosts = randomGroupPosts; - IQueryable expectedGroupPosts = storageGroupPosts; + IQueryable randomGroupPosts = + CreateRandomGroupPosts(); + + IQueryable storageGroupPosts = + randomGroupPosts; + + IQueryable expectedGroupPosts = + storageGroupPosts; this.storageBrokerMock.Setup(broker => - broker.SelectAllGroupPosts()).Returns(storageGroupPosts); + broker.SelectAllGroupPosts()) + .Returns(storageGroupPosts); //when - IQueryable actualGroupPosts = this.groupPostService.RetrieveAllGroupPosts(); + IQueryable actualGroupPosts = + this.groupPostService.RetrieveAllGroupPosts(); //then - actualGroupPosts.Should().BeEquivalentTo(expectedGroupPosts); + actualGroupPosts.Should().BeEquivalentTo( + expectedGroupPosts); this.storageBrokerMock.Verify(broker => broker.SelectAllGroupPosts(), Times.Once()); @@ -37,4 +45,4 @@ public void ShouldRetrieveAllGroupPosts() this.loggingBrokerMock.VerifyNoOtherCalls(); } } -} +} \ No newline at end of file diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.RetrieveById.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.RetrieveById.cs index 21cbc273..21b4568f 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.RetrieveById.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Logic.RetrieveById.cs @@ -16,7 +16,7 @@ namespace Taarafo.Core.Tests.Unit.Services.Foundations.GroupPosts public partial class GroupPostServiceTests { [Fact] - public async Task ShouldRetrieveGroupPostByIdAsync() + private async Task ShouldRetrieveGroupPostByIdAsync() { // given Guid randomGroupId = Guid.NewGuid(); diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.Add.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.Add.cs index 717f6e45..81a77a78 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.Add.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.Add.cs @@ -16,7 +16,7 @@ namespace Taarafo.Core.Tests.Unit.Services.Foundations.GroupPosts public partial class GroupPostServiceTests { [Fact] - public async Task ShouldThrowValidationExceptionOnAddIfGroupPostIsNullAndLogItAsync() + private async Task ShouldThrowValidationExceptionOnAddIfGroupPostIsNullAndLogItAsync() { // given GroupPost nullGroupPost = null; @@ -25,7 +25,9 @@ public async Task ShouldThrowValidationExceptionOnAddIfGroupPostIsNullAndLogItAs new NullGroupPostException(); var expectedGroupPostValidationException = - new GroupPostValidationException(nullGroupPostException); + new GroupPostValidationException( + message: "Group post validation error occurred, please try again.", + innerException: nullGroupPostException); // when ValueTask addGrouPostTask = @@ -49,7 +51,7 @@ await Assert.ThrowsAsync( } [Fact] - public async Task ShouldThrowValidationExceptionOnAddIfGroupPostIsInvalidAndLogItAsync() + private async Task ShouldThrowValidationExceptionOnAddIfGroupPostIsInvalidAndLogItAsync() { // given Guid invalidGuid = Guid.Empty; @@ -72,7 +74,9 @@ public async Task ShouldThrowValidationExceptionOnAddIfGroupPostIsInvalidAndLogI values: "Id is required"); var expectedGroupPostValidationException = - new GroupPostValidationException(invalidGrouPostException); + new GroupPostValidationException( + message: "Group post validation error occurred, please try again.", + innerException: invalidGrouPostException); // when ValueTask addGroupPostTask = @@ -99,4 +103,4 @@ await Assert.ThrowsAsync( this.loggingBrokerMock.VerifyNoOtherCalls(); } } -} +} \ No newline at end of file diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.Modify.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.Modify.cs index 5c4af410..09434f98 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.Modify.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.Modify.cs @@ -17,14 +17,16 @@ namespace Taarafo.Core.Tests.Unit.Services.Foundations.GroupPosts public partial class GroupPostServiceTests { [Fact] - public async Task ShouldThrowValidationExceptionOnModifyIfGroupPostIsNullAndLogItAsync() + private async Task ShouldThrowValidationExceptionOnModifyIfGroupPostIsNullAndLogItAsync() { // given GroupPost nullGroupPost = null; var nullGroupPostException = new NullGroupPostException(); var expectedGroupPostValidationException = - new GroupPostValidationException(nullGroupPostException); + new GroupPostValidationException( + message: "Group post validation error occurred, please try again.", + innerException: nullGroupPostException); // when ValueTask modifyGroupPostTask = @@ -50,7 +52,7 @@ await Assert.ThrowsAsync( [Theory] [InlineData(null, null)] - public async Task ShouldThrowValidationExceptionOnModifyIfGroupPostIsInvalidAndLogItAsync(Guid invalidGroupId, Guid invalidPostId) + private async Task ShouldThrowValidationExceptionOnModifyIfGroupPostIsInvalidAndLogItAsync(Guid invalidGroupId, Guid invalidPostId) { // given var invalidGroupPost = new GroupPost @@ -70,7 +72,9 @@ public async Task ShouldThrowValidationExceptionOnModifyIfGroupPostIsInvalidAndL values: "Id is required"); var expectedGroupPostValidationException = - new GroupPostValidationException(invalidGroupPostException); + new GroupPostValidationException( + message: "Group post validation error occurred, please try again.", + innerException: invalidGroupPostException); this.dateTimeBrokerMock.Setup(broker => broker.GetCurrentDateTimeOffset()) @@ -100,7 +104,7 @@ await Assert.ThrowsAsync( } [Fact] - public async Task ShouldThrowValidationExceptionOnModifyIfGroupPostDoesNotExistAndLogItAsync() + private async Task ShouldThrowValidationExceptionOnModifyIfGroupPostDoesNotExistAndLogItAsync() { // given int randomNegativeMinutes = GetRandomNegativeNumber(); @@ -113,7 +117,9 @@ public async Task ShouldThrowValidationExceptionOnModifyIfGroupPostDoesNotExistA nonExistGroupPost.PostId); var expectedGroupPostValidationException = - new GroupPostValidationException(notFoundGroupPostException); + new GroupPostValidationException( + message: "Group post validation error occurred, please try again.", + innerException: notFoundGroupPostException); this.storageBrokerMock.Setup(broker => broker.SelectGroupPostByIdAsync(nonExistGroupPost.GroupId, @@ -141,4 +147,4 @@ public async Task ShouldThrowValidationExceptionOnModifyIfGroupPostDoesNotExistA this.loggingBrokerMock.VerifyNoOtherCalls(); } } -} +} \ No newline at end of file diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.RemoveById.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.RemoveById.cs index edc52eeb..f540b231 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.RemoveById.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.RemoveById.cs @@ -16,7 +16,7 @@ namespace Taarafo.Core.Tests.Unit.Services.Foundations.GroupPosts public partial class GroupPostServiceTests { [Fact] - public async Task ShouldThrowValidationExceptionOnRemoveIfIdIsInvalidAndLogItAsync() + private async Task ShouldThrowValidationExceptionOnRemoveIfIdIsInvalidAndLogItAsync() { // given Guid invalidGroupId = Guid.Empty; @@ -33,7 +33,9 @@ public async Task ShouldThrowValidationExceptionOnRemoveIfIdIsInvalidAndLogItAsy values: "Id is required"); var expectedGroupPostValidationException = - new GroupPostValidationException(invalidGroupPostException); + new GroupPostValidationException( + message: "Group post validation error occurred, please try again.", + innerException: invalidGroupPostException); // when ValueTask removeGroupPostByIdTask = @@ -61,7 +63,7 @@ await Assert.ThrowsAsync( } [Fact] - public async Task ShouldThrowNotFoundExceptionOnRemoveIfGroupPostIsNotFoundAndLogItAsync() + private async Task ShouldThrowNotFoundExceptionOnRemoveIfGroupPostIsNotFoundAndLogItAsync() { //given DateTimeOffset randomDateTime = GetRandomDateTimeOffset(); @@ -74,7 +76,9 @@ public async Task ShouldThrowNotFoundExceptionOnRemoveIfGroupPostIsNotFoundAndLo new NotFoundGroupPostException(inputGroupId, inputPostld); var expectedGroupPostValidationException = - new GroupPostValidationException(notFoundGroupPostException); + new GroupPostValidationException( + message: "Group post validation error occurred, please try again.", + innerException: notFoundGroupPostException); this.storageBrokerMock.Setup(broker => broker.SelectGroupPostByIdAsync(inputGroupId, inputPostld)) @@ -107,4 +111,4 @@ await Assert.ThrowsAsync( this.loggingBrokerMock.VerifyNoOtherCalls(); } } -} +} \ No newline at end of file diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.RetrieveById.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.RetrieveById.cs index cf4c622a..d5d74368 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.RetrieveById.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.Validations.RetrieveById.cs @@ -16,7 +16,7 @@ namespace Taarafo.Core.Tests.Unit.Services.Foundations.GroupPosts public partial class GroupPostServiceTests { [Fact] - public async Task ShouldThrowValidationExceptionOnRetrieveByIdIfIdIsInvalidAndLogItAsync() + private async Task ShouldThrowValidationExceptionOnRetrieveByIdIfIdIsInvalidAndLogItAsync() { // given Guid invalidGroupId = Guid.Empty; @@ -33,7 +33,9 @@ public async Task ShouldThrowValidationExceptionOnRetrieveByIdIfIdIsInvalidAndLo values: "Id is required"); var expectedGroupPostValidationException = new - GroupPostValidationException(invalidGroupPostException); + GroupPostValidationException( + message: "Group post validation error occurred, please try again.", + innerException: invalidGroupPostException); // when ValueTask retrieveGroupPostByIdTask = @@ -61,7 +63,7 @@ await Assert.ThrowsAsync( } [Fact] - public async Task ShouldThrowNotFoundExceptionOnRetrieveByIdIfTeamIsNotFoundAndLogItAsync() + private async Task ShouldThrowNotFoundExceptionOnRetrieveByIdIfTeamIsNotFoundAndLogItAsync() { //given Guid someGroupId = Guid.NewGuid(); @@ -72,7 +74,9 @@ public async Task ShouldThrowNotFoundExceptionOnRetrieveByIdIfTeamIsNotFoundAndL new NotFoundGroupPostException(someGroupId, somePostId); var expectedGroupPostValidationException = - new GroupPostValidationException(notFoundGroupPostException); + new GroupPostValidationException( + message: "Group post validation error occurred, please try again.", + innerException: notFoundGroupPostException); this.storageBrokerMock.Setup(broker => broker.SelectGroupPostByIdAsync(someGroupId, somePostId)) diff --git a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.cs b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.cs index e0c2d2d2..769bbb74 100644 --- a/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.cs +++ b/Taarafo.Core.Tests.Unit/Services/Foundations/GroupPosts/GroupPostServiceTests.cs @@ -75,7 +75,7 @@ private static int GetRandomNegativeNumber() => private static GroupPost CreateRandomModifyGroupPost(DateTimeOffset dates) { int randomDaysInPast = GetRandomNegativeNumber(); - GroupPost randomGroupPost = CreateRandomGroupPost(dates); + GroupPost randomGroupPost = CreateRandomGroupPost(dates); return randomGroupPost; } @@ -104,4 +104,4 @@ private static Filler CreateGroupPostFiller(DateTimeOffset dates) return filler; } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Models/GroupPosts/Exceptions/AlreadyExistsGroupPostException.cs b/Taarafo.Core/Models/GroupPosts/Exceptions/AlreadyExistsGroupPostException.cs index 2e7c4609..48013cc6 100644 --- a/Taarafo.Core/Models/GroupPosts/Exceptions/AlreadyExistsGroupPostException.cs +++ b/Taarafo.Core/Models/GroupPosts/Exceptions/AlreadyExistsGroupPostException.cs @@ -11,8 +11,13 @@ namespace Taarafo.Core.Models.GroupPosts.Exceptions public class AlreadyExistsGroupPostException : Xeption { public AlreadyExistsGroupPostException(Exception innerException) - : base(message: "Group post with the same id already exists.", - innerException) + : base( + message: "Group post with the same id already exists.", + innerException: innerException) + { } + + public AlreadyExistsGroupPostException(string message, Exception innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Models/GroupPosts/Exceptions/FailedGroupPostServiceException.cs b/Taarafo.Core/Models/GroupPosts/Exceptions/FailedGroupPostServiceException.cs index 126720ff..a59c269f 100644 --- a/Taarafo.Core/Models/GroupPosts/Exceptions/FailedGroupPostServiceException.cs +++ b/Taarafo.Core/Models/GroupPosts/Exceptions/FailedGroupPostServiceException.cs @@ -11,7 +11,13 @@ namespace Taarafo.Core.Models.GroupPosts.Exceptions public class FailedGroupPostServiceException : Xeption { public FailedGroupPostServiceException(Exception innerException) - : base(message: "Failed group post service occurred, please contact support.", innerException) + : base( + message: "Failed group post service occurred, please contact support.", + innerException: innerException) + { } + + public FailedGroupPostServiceException(string message, Exception innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Models/GroupPosts/Exceptions/FailedGroupPostStorageException.cs b/Taarafo.Core/Models/GroupPosts/Exceptions/FailedGroupPostStorageException.cs index 07ce26a2..b93313a7 100644 --- a/Taarafo.Core/Models/GroupPosts/Exceptions/FailedGroupPostStorageException.cs +++ b/Taarafo.Core/Models/GroupPosts/Exceptions/FailedGroupPostStorageException.cs @@ -11,7 +11,13 @@ namespace Taarafo.Core.Models.GroupPosts.Exceptions public class FailedGroupPostStorageException : Xeption { public FailedGroupPostStorageException(Exception innerException) - : base(message: "Failed group post storage error occured, contact support.", innerException) + : base( + message: "Failed group post storage error occured, contact support.", + innerException: innerException) + { } + + public FailedGroupPostStorageException(string message, Exception innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostDependencyException.cs b/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostDependencyException.cs index dfeb7eab..e5006e2f 100644 --- a/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostDependencyException.cs +++ b/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostDependencyException.cs @@ -10,7 +10,13 @@ namespace Taarafo.Core.Models.GroupPosts.Exceptions public class GroupPostDependencyException : Xeption { public GroupPostDependencyException(Xeption innerException) - : base(message: "Group post dependency validation occurred, please try again.", innerException) + : base( + message: "Group post dependency validation occurred, please try again.", + innerException: innerException) + { } + + public GroupPostDependencyException(string message, Xeption innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostDependencyValidationException.cs b/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostDependencyValidationException.cs index 22a3f4fc..5ca74c0a 100644 --- a/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostDependencyValidationException.cs +++ b/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostDependencyValidationException.cs @@ -10,8 +10,13 @@ namespace Taarafo.Core.Models.GroupPosts.Exceptions public class GroupPostDependencyValidationException : Xeption { public GroupPostDependencyValidationException(Xeption innerException) - : base(message: "Group post dependency validation occurred, please try again.", - innerException) + : base( + message: "Group post dependency validation occurred, please try again.", + innerException: innerException) + { } + + public GroupPostDependencyValidationException(string message, Xeption innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostServiceException.cs b/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostServiceException.cs index 926bd9de..86130858 100644 --- a/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostServiceException.cs +++ b/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostServiceException.cs @@ -11,7 +11,13 @@ namespace Taarafo.Core.Models.GroupPosts.Exceptions public class GroupPostServiceException : Xeption { public GroupPostServiceException(Exception innerException) - : base(message: "Group post service error occurred, please contact support.", innerException) + : base( + message: "Group post service error occurred, please contact support.", + innerException: innerException) + { } + + public GroupPostServiceException(string message, Exception innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostValidationException.cs b/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostValidationException.cs index ff93979e..13c7f501 100644 --- a/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostValidationException.cs +++ b/Taarafo.Core/Models/GroupPosts/Exceptions/GroupPostValidationException.cs @@ -10,8 +10,13 @@ namespace Taarafo.Core.Models.GroupPosts.Exceptions public class GroupPostValidationException : Xeption { public GroupPostValidationException(Xeption innerException) - : base(message: "Group post validation error occurred, please try again.", - innerException) + : base( + message: "Group post validation error occurred, please try again.", + innerException: innerException) + { } + + public GroupPostValidationException(string message, Xeption innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Models/GroupPosts/Exceptions/InvalidGroupPostException.cs b/Taarafo.Core/Models/GroupPosts/Exceptions/InvalidGroupPostException.cs index 1242be7e..7f20613a 100644 --- a/Taarafo.Core/Models/GroupPosts/Exceptions/InvalidGroupPostException.cs +++ b/Taarafo.Core/Models/GroupPosts/Exceptions/InvalidGroupPostException.cs @@ -12,5 +12,9 @@ public class InvalidGroupPostException : Xeption public InvalidGroupPostException() : base(message: "Invalid group post. Please correct the errors and try again.") { } + + public InvalidGroupPostException(string message) + : base(message) + { } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Models/GroupPosts/Exceptions/InvalidGroupPostReferenceException.cs b/Taarafo.Core/Models/GroupPosts/Exceptions/InvalidGroupPostReferenceException.cs index 93f635b4..4d1043fb 100644 --- a/Taarafo.Core/Models/GroupPosts/Exceptions/InvalidGroupPostReferenceException.cs +++ b/Taarafo.Core/Models/GroupPosts/Exceptions/InvalidGroupPostReferenceException.cs @@ -11,7 +11,13 @@ namespace Taarafo.Core.Models.GroupPosts.Exceptions public class InvalidGroupPostReferenceException : Xeption { public InvalidGroupPostReferenceException(Exception innerException) - : base(message: "Invalid group post reference error occurred.", innerException) + : base( + message: "Invalid group post reference error occurred.", + innerException: innerException) + { } + + public InvalidGroupPostReferenceException(string message, Exception innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Models/GroupPosts/Exceptions/LockedGroupPostException.cs b/Taarafo.Core/Models/GroupPosts/Exceptions/LockedGroupPostException.cs index d4dd8114..6c216ce0 100644 --- a/Taarafo.Core/Models/GroupPosts/Exceptions/LockedGroupPostException.cs +++ b/Taarafo.Core/Models/GroupPosts/Exceptions/LockedGroupPostException.cs @@ -11,7 +11,13 @@ namespace Taarafo.Core.Models.GroupPosts.Exceptions public class LockedGroupPostException : Xeption { public LockedGroupPostException(Exception innerException) - : base(message: "GrouPost is locked, please try again.", innerException) + : base( + message: "GroupPost is locked, please try again.", + innerException: innerException) + { } + + public LockedGroupPostException(string message, Exception innerException) + : base(message, innerException) { } } } \ No newline at end of file diff --git a/Taarafo.Core/Models/GroupPosts/Exceptions/NotFoundGroupPostException.cs b/Taarafo.Core/Models/GroupPosts/Exceptions/NotFoundGroupPostException.cs index fcaae664..cdb07a90 100644 --- a/Taarafo.Core/Models/GroupPosts/Exceptions/NotFoundGroupPostException.cs +++ b/Taarafo.Core/Models/GroupPosts/Exceptions/NotFoundGroupPostException.cs @@ -13,5 +13,9 @@ public class NotFoundGroupPostException : Xeption public NotFoundGroupPostException(Guid groupId, Guid postId) : base(message: $"Couldn't find groupPost with id: {groupId}, {postId}.") { } + + public NotFoundGroupPostException(string message, Exception innerException) + : base(message, innerException) + { } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Models/GroupPosts/Exceptions/NullGroupPostException.cs b/Taarafo.Core/Models/GroupPosts/Exceptions/NullGroupPostException.cs index 7708f947..61ab67fc 100644 --- a/Taarafo.Core/Models/GroupPosts/Exceptions/NullGroupPostException.cs +++ b/Taarafo.Core/Models/GroupPosts/Exceptions/NullGroupPostException.cs @@ -12,5 +12,9 @@ public class NullGroupPostException : Xeption public NullGroupPostException() : base(message: "Group post is null.") { } + + public NullGroupPostException(string message) + : base(message) + { } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Models/GroupPosts/GroupPost.cs b/Taarafo.Core/Models/GroupPosts/GroupPost.cs index 053a3d22..a1f0e1ea 100644 --- a/Taarafo.Core/Models/GroupPosts/GroupPost.cs +++ b/Taarafo.Core/Models/GroupPosts/GroupPost.cs @@ -17,4 +17,4 @@ public class GroupPost public Guid PostId { get; set; } public Post Post { get; set; } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Services/Foundations/GroupPosts/GroupPostService.Exceptions.cs b/Taarafo.Core/Services/Foundations/GroupPosts/GroupPostService.Exceptions.cs index b4720adf..8f205060 100644 --- a/Taarafo.Core/Services/Foundations/GroupPosts/GroupPostService.Exceptions.cs +++ b/Taarafo.Core/Services/Foundations/GroupPosts/GroupPostService.Exceptions.cs @@ -17,10 +17,10 @@ namespace Taarafo.Core.Services.Foundations.GroupPosts { public partial class GroupPostService { - private delegate ValueTask ReturningPostFuntion(); + private delegate ValueTask ReturningGroupPostFuntion(); private delegate IQueryable ReturningGroupPostsFunction(); - private async ValueTask TryCatch(ReturningPostFuntion returningPostFuntion) + private async ValueTask TryCatch(ReturningGroupPostFuntion returningPostFuntion) { try { @@ -163,4 +163,4 @@ private GroupPostDependencyValidationException CreateAndDependencyValidationExce return groupPostDependencyValidationException; } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Services/Foundations/GroupPosts/GroupPostService.Validations.cs b/Taarafo.Core/Services/Foundations/GroupPosts/GroupPostService.Validations.cs index c66e4eba..68a7c174 100644 --- a/Taarafo.Core/Services/Foundations/GroupPosts/GroupPostService.Validations.cs +++ b/Taarafo.Core/Services/Foundations/GroupPosts/GroupPostService.Validations.cs @@ -92,4 +92,4 @@ private static void Validate(params (dynamic Rule, string Parameter)[] validatio invalidGroupPostException.ThrowIfContainsErrors(); } } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Services/Foundations/GroupPosts/GroupPostService.cs b/Taarafo.Core/Services/Foundations/GroupPosts/GroupPostService.cs index 33b31f78..fac17f09 100644 --- a/Taarafo.Core/Services/Foundations/GroupPosts/GroupPostService.cs +++ b/Taarafo.Core/Services/Foundations/GroupPosts/GroupPostService.cs @@ -80,4 +80,4 @@ public ValueTask RemoveGroupPostByIdAsync(Guid groupId, Guid postId) return await this.storageBroker.DeleteGroupPostAsync(maybeGroupPost); }); } -} +} \ No newline at end of file diff --git a/Taarafo.Core/Services/Foundations/GroupPosts/IGroupPostService.cs b/Taarafo.Core/Services/Foundations/GroupPosts/IGroupPostService.cs index dbc9a101..e4562291 100644 --- a/Taarafo.Core/Services/Foundations/GroupPosts/IGroupPostService.cs +++ b/Taarafo.Core/Services/Foundations/GroupPosts/IGroupPostService.cs @@ -18,4 +18,4 @@ public interface IGroupPostService ValueTask ModifyGroupPostAsync(GroupPost groupPost); ValueTask RemoveGroupPostByIdAsync(Guid groupId, Guid postId); } -} +} \ No newline at end of file