From 686a537861b3b34e532d961010a3e255daec7baf Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Fri, 20 Feb 2026 12:56:16 +0000 Subject: [PATCH] Refactor: simplify static calls, remove TODOs, modernize new() Removed redundant class name qualifiers for static method calls within PataPawaPostPayService, cleaned up outdated TODO comments regarding error handling, and updated object instantiation to use target-typed new() for improved code clarity and modern C# style. --- .../TestHosts/SoapServices/PataPawaPostPayService.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/TestHosts/TestHosts/SoapServices/PataPawaPostPayService.cs b/TestHosts/TestHosts/SoapServices/PataPawaPostPayService.cs index 7e089b2..59adf4c 100644 --- a/TestHosts/TestHosts/SoapServices/PataPawaPostPayService.cs +++ b/TestHosts/TestHosts/SoapServices/PataPawaPostPayService.cs @@ -68,9 +68,8 @@ public ProcessBillResponse ProcessBill(String username, String customer_name, Decimal amount) { using ResolvedDbContext? resolvedContext = this.ContextResolver.Resolve(PataPawaReadModelKey); - PostPaidAccount account = PataPawaPostPayService.GetAccount(username, api_key, resolvedContext.Context); + PostPaidAccount account = GetAccount(username, api_key, resolvedContext.Context); if (account == null) { - // TODO: this might not be the correct way to respond in this case return new ProcessBillResponse { Status = -1, Message = "Account not found" @@ -81,7 +80,6 @@ public ProcessBillResponse ProcessBill(String username, if (bill == null) { // Bill not found - // TODO: this might not be the correct way to respond in this case return new ProcessBillResponse { Status = -1, Message = $"Bill for account no [{account_no}] not found" @@ -107,7 +105,6 @@ public VerifyResponse VerifyAccount(String username, using ResolvedDbContext? resolvedContext = this.ContextResolver.Resolve(PataPawaReadModelKey); PostPaidAccount account = PataPawaPostPayService.GetAccount(username, api_key, resolvedContext.Context); if (account == null) { - // TODO: this might not be the correct way to respond in this case return new VerifyResponse { AccountNumber = null, AccountBalance = 0, @@ -121,7 +118,6 @@ public VerifyResponse VerifyAccount(String username, if (bill == null) { // Bill not found - // TODO: this might not be the correct way to respond in this case return new VerifyResponse { AccountNumber = null, AccountBalance = 0, @@ -142,7 +138,7 @@ public VerifyResponse VerifyAccount(String username, private static PostPaidAccount CreatePostPaidAccount(String username, String password, PataPawaContext context) { - PostPaidAccount account = new PostPaidAccount { + PostPaidAccount account = new() { Password = password, UserName = username, Balance = 0,