示例#1
0
        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}");
        }
示例#2
0
        static Receipt testReinstantiateReceipt(long RID)
        {
            ReceiptService rs = new ReceiptService();
            Receipt        r  = rs.getUsingID(RID);

            return(r);
        }
示例#3
0
        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);
        }
示例#4
0
 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();
 }
示例#5
0
        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);
        }
示例#6
0
        static void testSerializeReceipt(Receipt r)
        {
            ReceiptService rs = new ReceiptService();

            Console.WriteLine();
            foreach (string s in rs.serialize(r))
            {
                Console.WriteLine(s);
            }
        }
示例#7
0
        // --------------------------------------------------- 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);
        }
示例#8
0
        static void testDeleteReceipt(long RID)
        {
            ReceiptService rs = new ReceiptService();

            rs.delete(RID);
        }
示例#9
0
        static void testReceiptJSON(Receipt r)
        {
            ReceiptService rs = new ReceiptService();

            Console.WriteLine("\n" + rs.getJSON(r));
        }