Exemple #1
0
        static Subscription testAddSubscription()
        {
            Console.WriteLine("\n-------------------- Test: Creating A New Subscription, Write -------------------------");
            // Query DB for the next avail ID
            SubscriptionService subservice = new SubscriptionService();
            long SID = subservice.getNextAvailID();

            Console.WriteLine("Next available SID that can be assigned: " + SID + "\n");

            //Create a new Subscription
            long tempRID   = 2;
            long tempAccID = 2;

            Subscription sampleSub = new Subscription(SID, tempAccID, tempRID, new DateTime(2021, 02, 20, 0, 0, 0), (decimal)14.99, SubscriptionFrequency.Weekly);


            //Print summary of Subscription that was just created
            Console.WriteLine("Subscription Summary: \n-----------------------");
            Console.WriteLine(sampleSub);
            subservice.write(sampleSub);

            return(sampleSub);
        }