static void testDownloadReceipt(string userName, string fileName, string dstPath) { ReceiptService rs = new ReceiptService(); string downloadPath = rs.downloadFile(userName, fileName, dstPath); Console.WriteLine($"File {fileName} was downloaded from cloud storage to: {downloadPath}"); }
static Receipt testReinstantiateReceipt(long RID) { ReceiptService rs = new ReceiptService(); Receipt r = rs.getUsingID(RID); return(r); }
static void testUploadReceipt(string userName, string localPathToFile, string fileName) { ReceiptService rs = new ReceiptService(); string url = rs.uploadFile(userName, localPathToFile, fileName); Console.WriteLine($"Uploaded {fileName} to cloud storage at: " + url); }
public UserAccountService() { this.UserAccountDataAccess = new UserAccountDataAccess(); this.PasswordService = new PasswordService(); this.TransactionService = new TransactionService(); this.SGService = new SavingsGoalService(); this.RService = new ReceiptService(); this.SubService = new SubscriptionService(); }
static void testModifyRewriteReceipt(long RID) { ReceiptService rs = new ReceiptService(); Receipt r = rs.getUsingID(10); Console.WriteLine(r); r.setNote("This purchase is for a purchase!"); Console.WriteLine("\nAfter change: \n" + r); rs.update(r); }
static void testSerializeReceipt(Receipt r) { ReceiptService rs = new ReceiptService(); Console.WriteLine(); foreach (string s in rs.serialize(r)) { Console.WriteLine(s); } }
// --------------------------------------------------- Begin Receipt Testing --------------------------------------------------- static Receipt testAddReceipt() { Console.WriteLine("\n-------------------- Test: Creating A New Receipt, Write -------------------------"); // Query DB for the next avail ID ReceiptService rs = new ReceiptService(); long RID = rs.getNextAvailID(); Console.WriteLine("Next available RID that can be assigned: " + RID + "\n"); //Create a new Receipt long tempTransactionID = 1; string tempStringURL = "https://i.pinimg.com/736x/06/5e/86/065e86fe5eea5ff5ed21dff142eeba48.jpg"; Receipt sampleReceipt = new Receipt(RID, tempTransactionID, tempStringURL, new DateTime(2021, 03, 16, 0, 0, 0), "short note", newlyCreated: true); //Print summary of Receipt that was just created Console.WriteLine("Receipt Summary: \n-----------------------"); Console.WriteLine(sampleReceipt); rs.write(sampleReceipt); return(sampleReceipt); }
static void testDeleteReceipt(long RID) { ReceiptService rs = new ReceiptService(); rs.delete(RID); }
static void testReceiptJSON(Receipt r) { ReceiptService rs = new ReceiptService(); Console.WriteLine("\n" + rs.getJSON(r)); }