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

            return(r);
        }
Esempio n. 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);
        }
Esempio n. 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();
 }
Esempio n. 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);
        }
Esempio n. 6
0
        static void testSerializeReceipt(Receipt r)
        {
            ReceiptService rs = new ReceiptService();

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

            rs.delete(RID);
        }
Esempio n. 9
0
        static void testReceiptJSON(Receipt r)
        {
            ReceiptService rs = new ReceiptService();

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