Skip to content

Commit

Permalink
More changes from QA
Browse files Browse the repository at this point in the history
  • Loading branch information
tba76 committed Sep 12, 2023
1 parent ccd669c commit 4a943ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class EmailNotificationRepository : IEmailNotificationRepository
private readonly NpgsqlDataSource _dataSource;
private const string _insertEmailNotificationSql = "call notifications.insertemailnotification($1, $2, $3, $4, $5, $6, $7)"; // (__orderid, _alternateid, _recipientid, _toaddress, _result, _resulttime, _expirytime)
private const string _getEmailNotificationsSql = "select * from notifications.getemails_statusnew_updatestatus()";
private const string _setResultStatus = "call notifications.updateemailstatus($1, $2, $3)"; // (_alternateid, _result, _operationid)
private const string _updateEmailStatus = "call notifications.updateemailstatus($1, $2, $3)"; // (_alternateid, _result, _operationid)
private const string _getEmailRecipients = "select * from notifications.getemailrecipients($1)"; // (_alternateid)

/// <summary>
Expand Down Expand Up @@ -77,7 +77,7 @@ public async Task<List<Email>> GetNewNotifications()
/// <inheritdoc/>
public async Task UpdateSendStatus(Guid notificationId, EmailNotificationResultType status, string? operationId = null)
{
await using NpgsqlCommand pgcom = _dataSource.CreateCommand(_setResultStatus);
await using NpgsqlCommand pgcom = _dataSource.CreateCommand(_updateEmailStatus);
pgcom.Parameters.AddWithValue(NpgsqlDbType.Uuid, notificationId);
pgcom.Parameters.AddWithValue(NpgsqlDbType.Text, status.ToString());
pgcom.Parameters.AddWithValue(NpgsqlDbType.Text, operationId ?? (object)DBNull.Value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public async Task RunTask_ConfirmExpectedSideEffects()
.GetServices(new List<Type>() { typeof(IHostedService) }, vars)
.First(s => s.GetType() == typeof(EmailStatusConsumer))!;

_ = await PostgreUtil.PopulateDBWithOrderAndEmailNotification(_sendersRef);
(_, EmailNotification Notification) = await PostgreUtil.PopulateDBWithOrderAndEmailNotification(_sendersRef);

SendOperationResult sendOperationResult = new()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public async Task CreateEmailNotification_ToAddressDefined_ResultFailedRecipient
}

[Fact]
public async Task UpdateSendStatus()
public async Task UpdateSendStatus_SendResultDefined_Succeded()
{
// Arrange
Guid notificationid = Guid.NewGuid();
Expand All @@ -147,7 +147,7 @@ public async Task UpdateSendStatus()
{
NotificationId = notificationid,
OperationId = operationId,
SendResult= EmailNotificationResultType.Succeeded
SendResult = EmailNotificationResultType.Succeeded
};

var repoMock = new Mock<IEmailNotificationRepository>();
Expand All @@ -157,8 +157,8 @@ public async Task UpdateSendStatus()

// Act
await service.UpdateSendStatus(sendOperationResult);
// Assert

// Assert
repoMock.Verify();
}

Expand Down

0 comments on commit 4a943ef

Please sign in to comment.