/**
 * license: GPLv3
 reservationsystem
*/

package lodge;

import lodge.datamodel.Account;
import lodge.datamodel.Address;
import lodge.datamodel.EmailAddress;
import lodge.reservationsystem.AccomodationManager;

/**
 * The Tests for the ReservationSystem Module
 *
 * <p>
 * This class main function acts as a driver function to run the test functions.
 * </p>
 *
 * @author Sherwin Price
 * @version 1.0
 * @since 2025
 */
public final class TestAccountLoad {
        // Request that Manager updates specific account’s files with data stored in
        static void Test_AddAccount(AccomodationManager mgr, Account acct) throws Exception {
                mgr.AddAccount(acct);

                // 4. Request that Manager updates specific account’s files with data stored in
                // memory
                mgr.UpdateAccount(acct);
        }
        public static void main(String[] args) throws Exception {

                // Configure data repository
                AccomodationManager mgr = new AccomodationManager(AccomodationManager.getRepositoryConfig.getPath());

                // 3. Add new account object to the list managed by Manager (if account object
                // already exists on add action with the same account number, it is considered
                // an error)
                Test_AddAccount(mgr, mgr.newAccount("701-456-7890",
                                new Address("10 wilco ave", "wilco", "WY", "82801"),
                                new EmailAddress("wilco@wyommin.net")));

                Test_AddAccount(mgr, mgr.newAccount("701-456-7890",
                                new Address("10 wilco ave", "wilco", "WY", "82801"),
                                new EmailAddress("wilco@wyommin.net")));

                mgr.showAccountList();
                System.out.println("Program Completed.");
        }
}
