Пример #1
0
        /*
         * Preconditions: None
         * Postcondition: Form is initialized.
         */

        public Prog2Form()
        {
            InitializeComponent();


            upv.AddAddress("Helen C. Bice", "1163 Thompson Drive", "El Sobrante", "CA", 94803);
            upv.AddAddress("Teresa T. Johnson", "3542 Farland Street", "Apt 101", "Westborough", "MA", 01581);
            upv.AddAddress("Troy H. Thomas", "1299 Saints Alley", "Plant City", "FL", 33564);
            upv.AddAddress("Susan K. McCrady", "3118 Chenoweth Drive", "Apt B3", "Clarksville", "TN", 37040);
            upv.AddAddress("Nicholle C. Warren", "2187 Leo Street", "Pittsburgh", "PA", 15203);
            upv.AddAddress("Vanessa P. Burgos", "373 Wayback Lane", "New York", "NY", 10013);
            upv.AddAddress("Amy T. Hight", "4254 Valley Drive", "North Wales", "PA", 19454);
            upv.AddAddress("Lauren A. Proffitt", "2269 Boggess Street", "Apt 101", "Wichita Falls", "TX", 76301);

            upv.AddGroundPackage(upv.AddressAt(0), upv.AddressAt(1), 5, 5, 6, 1);
            upv.AddGroundPackage(upv.AddressAt(0), upv.AddressAt(1), 30, 42, 18, 60);
            upv.AddNextDayAirPackage(upv.AddressAt(0), upv.AddressAt(3), 40, 20, 60, 74, 10M);
            upv.AddNextDayAirPackage(upv.AddressAt(4), upv.AddressAt(2), 10, 13, 13, 100, 50M);
            upv.AddTwoDayAirPackage(upv.AddressAt(2), upv.AddressAt(1), 20, 25, 50, 75, TwoDayAirPackage.Delivery.Early);
            upv.AddTwoDayAirPackage(upv.AddressAt(2), upv.AddressAt(3), 40, 40, 20, 76, TwoDayAirPackage.Delivery.Saver);
            upv.AddLetter(upv.AddressAt(2), upv.AddressAt(0), 0.46M);
            upv.AddLetter(upv.AddressAt(4), upv.AddressAt(6), 0.77M);
            upv.AddGroundPackage(upv.AddressAt(7), upv.AddressAt(5), 30, 23, 98, 12);
            upv.AddNextDayAirPackage(upv.AddressAt(3), upv.AddressAt(6), 22, 32, 18, 32, 15M);
        }
Пример #2
0
        private UserParcelView upv; // The UserParcelView
        // Preconditon: None
        // Postconditon: Prog2 form is initialized
        public Prog2Form()
        {
            InitializeComponent();

            upv = new UserParcelView();
            // test data
            upv.AddAddress("  John Smith  ", "   123 Any St.   ", "  Apt. 45 ",
                           "  Louisville   ", "  KY   ", 40202);                                                          // Test Address 1
            upv.AddAddress("Jane Doe", "987 Main St.",
                           "Beverly Hills", "CA", 90210);                                                                 // Test Address 2
            upv.AddAddress("James Kirk", "654 Roddenberry Way", "Suite 321",
                           "El Paso", "TX", 79901);                                                                       // Test Address 3
            upv.AddAddress("John Crichton", "678 Pau Place", "Apt. 7",
                           "Portland", "ME", 04101);                                                                      // Test Address 4
            upv.AddAddress("John Doe", "111 Market St.",
                           "Jeffersonville", "IN", 47130);                                                                // Test Address 5
            upv.AddAddress("Jane Smith", "55 Hollywood Blvd.", "Apt. 9",
                           "Los Angeles", "CA", 90212);                                                                   // Test Address 6
            upv.AddAddress("Captain Robert Crunch", "21 Cereal Rd.", "Room 987",
                           "Bethesda", "MD", 20810);                                                                      // Test Address 7
            upv.AddAddress("Vlad Dracula", "6543 Vampire Way", "Apt. 1",
                           "Bloodsucker City", "TN", 37210);                                                              // Test Address 8

            upv.AddLetter(upv.AddressAt(0), upv.AddressAt(1), 5.00M);                                                     // Letter test object
            upv.AddLetter(upv.AddressAt(2), upv.AddressAt(3), 2.50M);                                                     // Letter test object
            upv.AddGroundPackage(upv.AddressAt(4), upv.AddressAt(5), 4.5, 5.0, 10, 25);                                   //groundpackage test object
            upv.AddGroundPackage(upv.AddressAt(6), upv.AddressAt(7), 7, 5, 10, 30);                                       // groundpackage test object
            upv.AddNextDayAirPackage(upv.AddressAt(6), upv.AddressAt(0), 10, 15, 8.5, 10, 20.50M);                        //NextDayAirPackage test object
            upv.AddNextDayAirPackage(upv.AddressAt(3), upv.AddressAt(7), 15, 18, 20, 45, 50.75M);                         //NextDayAirPackage test object
            upv.AddTwoDayAirPackage(upv.AddressAt(2), upv.AddressAt(7), 12, 14, 11, 34, TwoDayAirPackage.Delivery.Saver); //TwoDayAirPackage test object
            upv.AddTwoDayAirPackage(upv.AddressAt(1), upv.AddressAt(5), 10, 5, 19, 48, TwoDayAirPackage.Delivery.Early);  //TwoDayAirPackage test objec
        }
Пример #3
0
        private UserParcelView upv; // Declare upv variable to be used on shipping

        public Prog2Form()
        {
            InitializeComponent();

            upv = new UserParcelView(); // upv assigned as userparcelview method

            upv.AddAddress("  John Smith  ", "   123 Any St.   ", "  Apt. 45 ",
                           "  Louisville   ", "  KY   ", 40202);                                                                  // Test Address 1
            upv.AddAddress("Jane Doe", "987 Main St.",
                           "Beverly Hills", "CA", 90210);                                                                         // Test Address 2
            upv.AddAddress("James Kirk", "654 Roddenberry Way", "Suite 321",
                           "El Paso", "TX", 79901);                                                                               // Test Address 3
            upv.AddAddress("John Crichton", "678 Pau Place", "Apt. 7",
                           "Portland", "ME", 04101);                                                                              // Test Address 4
            upv.AddAddress("John Doe", "111 Market St.",
                           "Jeffersonville", "IN", 47130);                                                                        // Test Address 5
            upv.AddAddress("Jane Smith", "55 Hollywood Blvd.", "Apt. 9",
                           "Los Angeles", "CA", 90212);                                                                           // Test Address 6
            upv.AddAddress("Captain Robert Crunch", "21 Cereal Rd.", "Room 987",
                           "Bethesda", "MD", 20810);                                                                              // Test Address 7
            upv.AddAddress("Vlad Dracula", "6543 Vampire Way", "Apt. 1",
                           "Bloodsucker City", "TN", 37210);                                                                      // Test Address 8

            upv.AddLetter(upv.AddressAt(0), upv.AddressAt(1), 3.95M);                                                             // Add letter using upv
            upv.AddLetter(upv.AddressAt(2), upv.AddressAt(3), 4.25M);                                                             // Add letter using upv
            upv.AddGroundPackage(upv.AddressAt(4), upv.AddressAt(5), 14, 10, 5, 12.5);                                            // Add groundpackage using upv
            upv.AddGroundPackage(upv.AddressAt(6), upv.AddressAt(7), 8.5, 9.5, 6.5, 2.5);                                         // Add groundpackage using upv
            upv.AddNextDayAirPackage(upv.AddressAt(0), upv.AddressAt(2), 25, 15, 15, 85, 7.50M);                                  // Add nextdayairpackage using upv
            upv.AddNextDayAirPackage(upv.AddressAt(2), upv.AddressAt(4), 9.5, 6.0, 5.5, 5.25, 5.25M);                             // Add nextdayairpackage using upv
            upv.AddNextDayAirPackage(upv.AddressAt(1), upv.AddressAt(6), 10.5, 6.5, 9.5, 15.5, 5.00M);                            // Add nextdayairpackage using upv
            upv.AddTwoDayAirPackage(upv.AddressAt(4), upv.AddressAt(6), 46.5, 39.5, 28.0, 80.5, TwoDayAirPackage.Delivery.Saver); // Add twodayairpackage using upv
            upv.AddTwoDayAirPackage(upv.AddressAt(7), upv.AddressAt(0), 15.0, 9.5, 6.5, 75.5, TwoDayAirPackage.Delivery.Early);   // Add twodayairpackage using upv
            upv.AddTwoDayAirPackage(upv.AddressAt(5), upv.AddressAt(3), 12.0, 12.0, 6.0, 5.5, TwoDayAirPackage.Delivery.Saver);   // Add twodayairpackage using upv
        }
Пример #4
0
        public UserParcelView upv = new UserParcelView(); //creates a UserParcelView object
        public MainForm()
        {
            InitializeComponent();


            //pre-stored address values for quick testing
            upv.AddAddress("  John Smith  ", "   123 Any St.   ", "  Apt. 45", "Louisville   ", "  KY   ", 40202);       // Test Address 1
            upv.AddAddress("Jane Doe", "987 Main St.", "Beverly Hills", "CA", 90210);                                    // Test Address 2
            upv.AddAddress("James Kirk", "654 Roddenberry Way", "Suite 321", "El Paso", "TX", 79901);                    // Test Address 3
            upv.AddAddress("John Crichton", "678 Pau Place", "Apt. 7", "Portland", "ME", 04101);                         // Test Address 4

            upv.AddAddress("Test name", "Test address_1", "Test address_2", "Test city", "Test state", 99999);           //Test address 5
            upv.AddAddress("Joe", "123 The Street", "wut", "NYC", "NY", 12345);                                          //Test address 6
            upv.AddAddress("Dr. Wright", "I dont know where you live", "Louisville", "KY", 40217);                       //Test address 7
            upv.AddAddress("'Ol McDonald", "had a farm", "               eee eye eee eye", "Farmville", "T E X A S", 5); //Test address 8

            upv.AddLetter(upv.AddressAt(0), upv.AddressAt(2), 0.50M);                                                    // Test Letter 1
            upv.AddLetter(upv.AddressAt(2), upv.AddressAt(2), 1.20M);                                                    // Test Letter 2
            upv.AddLetter(upv.AddressAt(4), upv.AddressAt(0), 1.70M);                                                    // Test Letter 3

            upv.AddGroundPackage(upv.AddressAt(4), upv.AddressAt(5), 5, 10, 1, 100);                                     //Test Groundpackage 1
            upv.AddGroundPackage(upv.AddressAt(0), upv.AddressAt(6), 10, 10, 5, 25);                                     //Test Groundpackage 2

            upv.AddNextDayAirPackage(upv.AddressAt(5), upv.AddressAt(6), 5, 10, 1, 100, 150);                            //Test Next Day Air Package Heavy
            upv.AddNextDayAirPackage(upv.AddressAt(5), upv.AddressAt(6), 5, 10, 100, 49.9, 150);                         //Test Next Day Air Package Large
            upv.AddNextDayAirPackage(upv.AddressAt(5), upv.AddressAt(5), 5, 10, 100, 50, 150);                           //Test Next Day Air Package Large & Heavy

            upv.AddTwoDayAirPackage(upv.AddressAt(7), upv.AddressAt(3), 5, 10, 1, 150, TwoDayAirPackage.Delivery.Saver); //Test Two Day Air Package that is a Saver
            upv.AddTwoDayAirPackage(upv.AddressAt(6), upv.AddressAt(2), 5, 10, 1, 75, TwoDayAirPackage.Delivery.Early);  //Test Two Day Air Package that is a Early
        }
Пример #5
0
        string NL = Environment.NewLine;    //  Stores NewLine shortcut

        //  Precondition: None
        //  Postcondition:  Initializes program and all test objects
        public Prog2Form()
        {
            InitializeComponent();

            upv = new UserParcelView();

            //  creates eight test Address objects
            upv.AddAddress("Rrose Selavy", "5454 Dada Ave.", "Apt. 66", "New York", "Ny", 10019);
            upv.AddAddress("Leonora Carrington", "9632 Hyena Blvd.", "Ojai", "CA", 90322);
            upv.AddAddress("Meret Oppenheim", "54 Teacup Ln.", "Apt. 3", "Chicago", "IL", 34998);
            upv.AddAddress("Joan Miro", "9021 Sculpture Dr.", "Portland", "OR", 98069);
            upv.AddAddress("Hugo Ball", "901 Century Ct.", "Miami", "FL", 20001);
            upv.AddAddress("Leonor Fini", "306 Lake Pl.", "Unit 4C", "Denver", "CO", 76663);
            upv.AddAddress("Tristan Tzara", "5050 Paris St.", "Omaha", "NE", 55091);
            upv.AddAddress("Marcel Duchamp", "669 R. Mutt NE", "Woodinville", "WA", 99886);

            //  creates eight test Parcel objects
            upv.AddLetter(upv.AddressAt(0), upv.AddressAt(1), 3.75M);
            upv.AddLetter(upv.AddressAt(3), upv.AddressAt(4), 2.25M);
            upv.AddGroundPackage(upv.AddressAt(5), upv.AddressAt(6), 10, 5.5, 2, 2);
            upv.AddGroundPackage(upv.AddressAt(6), upv.AddressAt(7), 7, 3, 1.5, 17);
            upv.AddNextDayAirPackage(upv.AddressAt(0), upv.AddressAt(7), 10, 12, 6.5, 9, 12.50M);
            upv.AddNextDayAirPackage(upv.AddressAt(1), upv.AddressAt(6), 30, 24, 12, 83, 25.0M);
            upv.AddTwoDayAirPackage(upv.AddressAt(2), upv.AddressAt(5), 24, 13.5, 3, 77, TwoDayAirPackage.Delivery.Early);
            upv.AddTwoDayAirPackage(upv.AddressAt(3), upv.AddressAt(4), 36, 36, 36, 45, TwoDayAirPackage.Delivery.Saver);
        }
        public UserParcelView upv; //The UserParcelView

        // Precondition: None
        // Postcondition: The form's GUI is prepared for display.
        public Prog2Form()
        {
            InitializeComponent();

            upv = new UserParcelView();

            //Test Data
            upv.AddAddress("John Smith", "123 Any St.", "Apt. 45",
                           "Louisville", "KY", 40202);    // Test Address 1
            upv.AddAddress("Jane Doe", "987 Main St.",
                           "Beverly Hills", "CA", 90210); // Test Address 2
            upv.AddAddress("James Kirk", "654 Roddenberry Way", "Suite 321",
                           "El Paso", "TX", 79901);       // Test Address 3
            upv.AddAddress("John Crichton", "678 Pau Place", "Apt. 7",
                           "Portland", "ME", 04101);      // Test Address 4
            upv.AddAddress("Billy Walsh", "123 Hollywood Lane",
                           "Pasadena", "CA", 10100);      // Test Address 5
            upv.AddAddress("Vincent Chase", "456 Rich Road",
                           "Los Angeles", "CA", 75432);   // Test Address 6
            upv.AddAddress("Eric Murphy", "111 Short Street",
                           "Benton", "KY", 42025);        // Test Address 7
            upv.AddAddress("Ari Gold", "414 Fairview Street", "Apt. 12",
                           "Paducah", "KY", 83325);       // Test Address 8

            // Letter test objects
            upv.AddLetter(upv.AddressAt(0), upv.AddressAt(1), 3.95M);
            upv.AddLetter(upv.AddressAt(2), upv.AddressAt(3), 4.25M);

            // Ground Package test objects
            upv.AddGroundPackage(upv.AddressAt(4), upv.AddressAt(5), 14, 10, 5, 12.5);
            upv.AddGroundPackage(upv.AddressAt(6), upv.AddressAt(7), 20, 7, 4, 20);


            // Next Day Air Package test objects
            upv.AddNextDayAirPackage(upv.AddressAt(0), upv.AddressAt(2), 25, 15, 15,
                                     85, 7.50M);
            upv.AddNextDayAirPackage(upv.AddressAt(2), upv.AddressAt(4), 11, 22, 9,
                                     70, 7.38M);
            upv.AddNextDayAirPackage(upv.AddressAt(1), upv.AddressAt(6), 10.5, 20, 11,
                                     75, 7.38M);


            // Two Day Air Package test objects
            upv.AddTwoDayAirPackage(upv.AddressAt(6), upv.AddressAt(3), 46.5, 39.5, 28.0,
                                    80.5, TwoDayAirPackage.Delivery.Saver);
            upv.AddTwoDayAirPackage(upv.AddressAt(7), upv.AddressAt(5), 46.5, 39.5, 28.0,
                                    80.5, TwoDayAirPackage.Delivery.Early);
            upv.AddTwoDayAirPackage(upv.AddressAt(1), upv.AddressAt(0), 46.5, 39.5, 28.0,
                                    80.5, TwoDayAirPackage.Delivery.Saver);
        }
 // Precondition:  None
 // Postcondition: Helper method to add test parcels to the upv
 private void AddLetters()
 {
     // Add test data to upv list
     upv.AddGroundPackage(upv.AddressAt(0), upv.AddressAt(7), 12, 4, 6, 2);
     upv.AddNextDayAirPackage(upv.AddressAt(1), upv.AddressAt(6), 25, 5, 5, 15, 35.00m);
     upv.AddLetter(upv.AddressAt(2), upv.AddressAt(5), 1.25m);
     upv.AddLetter(upv.AddressAt(3), upv.AddressAt(4), 1.25m);
 }
Пример #8
0
        private UserParcelView upv; //UserParcelView

        //Precondition: None
        //Postcondition: GUI form is created
        //               Creates address form and letter form
        //               if the user selects those options from
        //               the menu.
        //               Data collected from this form is sent to
        //               the UserParcelView class to be created
        //               into lists.
        public Prog2Form()
        {
            //Precondition: None
            //Postcondition: Form is created
            InitializeComponent();

            //Creating an object of the UserParcelView
            upv = new UserParcelView();

            //Test Data: Addresses
            upv.AddAddress("  John Smith  ", "   123 Any St.   ", "  Apt. 45 ",
                           "  Louisville   ", "  KY   ", 40202); // Test Address 1
            upv.AddAddress("Jane Doe", "987 Main St.",
                           "Beverly Hills", "CA", 90210);        // Test Address 2
            upv.AddAddress("James Kirk", "654 Roddenberry Way", "Suite 321",
                           "El Paso", "TX", 79901);              // Test Address 3
            upv.AddAddress("John Crichton", "678 Pau Place", "Apt. 7",
                           "Portland", "ME", 04101);             // Test Address 4
            upv.AddAddress("Charlotte Jones", "123 Maple St. ",
                           "Clarksville", "IN", 47129);          // Test Address 5
            upv.AddAddress("Kayla Kay", "989 Chipp Avenue", "Apt. 2",
                           "Salem", "IN", 52143);                // Test Address 6
            upv.AddAddress("Hunter Ansleigh", "554 Herrick Way",
                           "Jeffersonville", "IN", 47130);       // Test Address 7
            upv.AddAddress("Mckenzie Caldwell", "2201 Morgan Avenue",
                           "Charlestown", "KY", 42450);          // Test Address 8


            //Test Data: Letters
            upv.AddLetter(upv.AddressAt(0), upv.AddressAt(1), 3.95M);
            upv.AddLetter(upv.AddressAt(3), upv.AddressAt(2), 2.05M);

            //Test Data: GroundPackages
            upv.AddGroundPackage(upv.AddressAt(2), upv.AddressAt(3), 14, 10, 5, 12.5);
            upv.AddGroundPackage(upv.AddressAt(1), upv.AddressAt(5), 22, 15, 16, 28);

            //Test Data: NextDayAirPackages
            upv.AddNextDayAirPackage(upv.AddressAt(5), upv.AddressAt(0), 25, 15, 15, 85, 7.50M);
            upv.AddNextDayAirPackage(upv.AddressAt(1), upv.AddressAt(2), 50, 20, 15, 120, 9.75M);

            //Test Data: TwoDayAirPackages
            upv.AddTwoDayAirPackage(upv.AddressAt(3), upv.AddressAt(2), 46.5, 39.5, 28.0, 80.5, TwoDayAirPackage.Delivery.Saver);
            upv.AddTwoDayAirPackage(upv.AddressAt(7), upv.AddressAt(6), 20.75, 16.20, 20.50, 120.75, TwoDayAirPackage.Delivery.Early);
        }
Пример #9
0
        //precondition: none.
        //postcondition: preloads test information into program.
        private void mainForm_Load(object sender, EventArgs e)
        {
            formObject.AddAddress("John Smith", "123 Any St.", "Apt. 45", "Louisville", "KY", 40202);          // Test Address 1
            formObject.AddAddress("Jane Doe", "987 Main St.", "Beverly Hills", "CA", 90210);                   // Test Address 2
            formObject.AddAddress("James Kirk", "654 Roddenberry Way", "Suite 321", "El Paso", "TX", 79901);   // Test Address 3
            formObject.AddAddress("John Crichton", "678 Pau Place", "Apt. 7", "Portland", "ME", 04101);        // Test Address 4
            formObject.AddAddress("Tim Jones", "865 Good Music Drive", "Nashville", "TN", 37027);              // Test Address 5
            formObject.AddAddress("Jonny Banana", "942 Private Beach Drive", "Clearwater", "FL", 33755);       // Test Address 6
            formObject.AddAddress("Juan Martinez", "15946 Big Hat Lane", "Apt. 5B", "Austin", "TX", 73344);    // Test Address 7
            formObject.AddAddress("Frank Chowder", "321 Too Cold Way", "Manchester", "NH", 03107);             // Test Address 8

            formObject.AddLetter(formObject.AddressAt(0), formObject.AddressAt(5), 3.95M);                     //test Letter parcel
            formObject.AddLetter(formObject.AddressAt(2), formObject.AddressAt(7), 5.25M);                     //test Letter parcel
            formObject.AddLetter(formObject.AddressAt(4), formObject.AddressAt(1), 0.55M);                     //test Letter parcel

            formObject.AddGroundPackage(formObject.AddressAt(3), formObject.AddressAt(7), 23, 12, 10, 45);     //test groundPackag parcel
            formObject.AddGroundPackage(formObject.AddressAt(6), formObject.AddressAt(1), 5, 25, 30, 15);      //test groundPackag parcel
            formObject.AddGroundPackage(formObject.AddressAt(5), formObject.AddressAt(5), 15, 35, 40, 75);     //test groundPackag parcel
        }
        public Prog2Form()
        {
            InitializeComponent();

            upv = new UserParcelView();

            // Test Data - Magic Numbers OK
            upv.AddAddress("  John Smith  ", "   123 Any St.   ", "  Apt. 45 ",
                           "  Louisville   ", "  KY   ", 40202); // Test Address 1
            upv.AddAddress("Jane Doe", "987 Main St.",
                           "Beverly Hills", "CA", 90210);        // Test Address 2
            upv.AddAddress("James Kirk", "654 Roddenberry Way", "Suite 321",
                           "El Paso", "TX", 79901);              // Test Address 3
            upv.AddAddress("John Crichton", "678 Pau Place", "Apt. 7",
                           "Portland", "ME", 04101);             // Test Address 4
            upv.AddAddress("Lester Joy", "156 Hunters Place",
                           "Benton", "KY", 40114);               // Test Address 5
            upv.AddAddress("Ben Polly", "67 Young Street",
                           "Danville", "CA", 92108);             // Test Address 6
            upv.AddAddress("Hillary Mont", "791 Prog Ave",
                           "Polar", "AL", 56123);                // Test Address 7
            upv.AddAddress("Monica Key", "091 Mice Ave",
                           "Welro", "MI", 40981);                // Test Address 8


            upv.AddLetter(upv.AddressAt(0), upv.AddressAt(1), 3.95M);                  // Letter test object
            upv.AddLetter(upv.AddressAt(3), upv.AddressAt(5), 8.67M);
            upv.AddGroundPackage(upv.AddressAt(6), upv.AddressAt(7), 14, 10, 5, 12.5); // Ground test object
            upv.AddGroundPackage(upv.AddressAt(2), upv.AddressAt(4), 65, 43, 87, 115);
            upv.AddNextDayAirPackage(upv.AddressAt(3), upv.AddressAt(1), 25, 15, 15,   // Next Day test object
                                     85, 7.50M);
            upv.AddNextDayAirPackage(upv.AddressAt(7), upv.AddressAt(0), 34, 23, 56,
                                     180, 9.80M);
            upv.AddTwoDayAirPackage(upv.AddressAt(2), upv.AddressAt(6), 46.5, 39.5, 28.0, // Two Day test object
                                    300, TwoDayAirPackage.Delivery.Saver);
            upv.AddTwoDayAirPackage(upv.AddressAt(4), upv.AddressAt(5), 40.5, 45.3, 82.5,
                                    400, TwoDayAirPackage.Delivery.Early);
        }
Пример #11
0
        private UserParcelView upv; //Will hold all addresses and parcels

        //Precondition: None
        //Postcondition: Program runs and initializes all addresses and parcels
        public Prog2Form()
        {
            InitializeComponent();

            upv = new UserParcelView(); //Instantiate UserParcelView

            // Test Data - Magic Numbers OK
            upv.AddAddress("  John Smith  ", "   123 Any St.   ", "  Apt. 45 ",
                           "  Louisville   ", "  KY   ", 40202); // Test Address 1
            upv.AddAddress("Jane Doe", "987 Main St.",
                           "Beverly Hills", "CA", 90222);        // Test Address 2
            upv.AddAddress("James Kirk", "654 Roddenberry Way", "Suite 321",
                           "El Paso", "TX", 79901);              // Test Address 3
            upv.AddAddress("John Crichton", "678 Pau Place", "Apt. 7",
                           "Portland", "ME", 04101);             // Test Address 4
            upv.AddAddress("Patrick Warren", "8431 Easton Commons Dr", "Apt. B",
                           "Louisville", "Ky", 40242);           //Test Address 5
            upv.AddAddress("Stan Lee", "9440 Santa Monica Blvd", "Suite 620",
                           "Beveryly Hills", "CA", 90210);       //Test Address 6
            upv.AddAddress("Eric McDowell", "2940 Yorkshire Blvd", "Louisville",
                           "Ky", 40220);
            upv.AddAddress("Harry Potter", "123 6th St.", "Melbourne",
                           "FL", 32904);

            upv.AddLetter(upv.AddressAt(0), upv.AddressAt(1), 4.95M);                     // Letter test object
            upv.AddGroundPackage(upv.AddressAt(2), upv.AddressAt(3), 14, 10, 5, 14.5);    // Ground test object
            upv.AddNextDayAirPackage(upv.AddressAt(0), upv.AddressAt(2), 25, 15, 15,      // Next Day test object
                                     90, 8.50M);
            upv.AddTwoDayAirPackage(upv.AddressAt(3), upv.AddressAt(0), 46.5, 39.5, 28.0, // Two Day test object
                                    130, TwoDayAirPackage.Delivery.Saver);
            upv.AddLetter(upv.AddressAt(4), upv.AddressAt(5), 3.95M);                     // Letter test object
            upv.AddGroundPackage(upv.AddressAt(6), upv.AddressAt(7), 14, 10, 5, 12.5);    // Ground test object
            upv.AddNextDayAirPackage(upv.AddressAt(4), upv.AddressAt(6), 25, 15, 15,      // Next Day test object
                                     100.5, 7.50M);
            upv.AddTwoDayAirPackage(upv.AddressAt(7), upv.AddressAt(4), 46.5, 39.5, 28.0, // Two Day test object
                                    95, TwoDayAirPackage.Delivery.Saver);
        }
Пример #12
0
        private UserParcelView upv; //UPV

        //Precondition: None
        //Postcondition: GUI prepared for display
        public Prog2Form()
        {
            InitializeComponent();

            upv = new UserParcelView();

            upv.AddAddress("Judy Cox", "2749 Duck Creek Road",
                           "Palo Alto", "CA", 94306);                                              //Test Address 1
            upv.AddAddress("Rebecca Norris", "626 Kembery Drive",
                           "Bucks", "AL", 36512);                                                  //Test Address 2
            upv.AddAddress("Jerry Owen", "2147 Eagles Nest Drive", "Apt. 2",
                           "Sacramento", "CA", 95814);                                             //Test Address 3
            upv.AddAddress("Francis Underwood", "1600 Pennsylvania Ave. NW",
                           "Washington", "DC", 20500);                                             //Test Address 4
            upv.AddAddress("Shrimply Pibbles", "123 Galactic Federation Dr.",
                           "Seattle", "WA", 98155);                                                //Test Address 5
            upv.AddAddress("Humany McHumanface", "745 Address Ave.",
                           "Louisville", "KY", 40245);                                             //Test Address 6
            upv.AddAddress("Namey McNameface", "4923 Addressy McAddressface Way",
                           "Glendale", "CA", 91204);                                               //Test Address 7
            upv.AddAddress("Jerry Seinfeld", "129 West 81st St.", "Apartment 5A",
                           "New York", "NY", 10017);                                               //Test Address 8

            upv.AddLetter(upv.AddressAt(0), upv.AddressAt(2), 3.50M);                              //Test Letter 1
            upv.AddLetter(upv.AddressAt(3), upv.AddressAt(4), 2.00M);                              //Test Letter 2

            upv.AddGroundPackage(upv.AddressAt(5), upv.AddressAt(6), 10, 10, 10, 20);              //Test GP 1
            upv.AddGroundPackage(upv.AddressAt(7), upv.AddressAt(5), 100, 75, 25, 80);             //Test GP 2

            upv.AddNextDayAirPackage(upv.AddressAt(1), upv.AddressAt(5), 5, 5, 5, 15, 10.00M);     //Test NDAP 1
            upv.AddNextDayAirPackage(upv.AddressAt(2), upv.AddressAt(3), 2.5, 2.6, 2.7, 5, 5.00M); //Test NDAP 2

            upv.AddTwoDayAirPackage(upv.AddressAt(4), upv.AddressAt(0), 10, 15, 20, 25,
                                    TwoDayAirPackage.Delivery.Saver); //Test TDAP 1
            upv.AddTwoDayAirPackage(upv.AddressAt(6), upv.AddressAt(7), 30, 30, 30, 300,
                                    TwoDayAirPackage.Delivery.Early); //Test TDAP2
        }
Пример #13
0
        private UserParcelView _upvTest = new UserParcelView(); //Object that contains all test data and new data as program runs

        //Constructor
        //precondition: must have UPV object to store test data
        //postcondition: main form GUI is initialized
        public Prog2Form()
        {
            //Test Data: Addresses
            _upvTest.AddAddress("John Smith", "123 Any St.", "Apt. 45",
                                "Louisville", "KY", 40202);    // Test Address 1
            _upvTest.AddAddress("Jane Doe", "987 Main St.", "",
                                "Beverly Hills", "CA", 90210); // Test Address 2
            _upvTest.AddAddress("James Kirk", "654 Roddenberry Way", "Suite 321",
                                "El Paso", "TX", 79901);       // Test Address 3
            _upvTest.AddAddress("John Crichton", "678 Pau Place", "Apt. 7",
                                "Portland", "ME", 04101);      // Test Address 4
            _upvTest.AddAddress("James Haverstock", "10101 Linn Station Rd", "Suite 200",
                                "Louisville", "KY", 40223);    // Test Address 5
            _upvTest.AddAddress("Paul Jacob", "4107 SpyGlass Ct", "",
                                "Louisville", "KY", 40229);    // Test Address 6
            _upvTest.AddAddress("Laura Payne", "320 E Esplenade Ave", "",
                                "Louisville", "KY", 40213);    // Test Address 7
            _upvTest.AddAddress("Geraldine Spicer", "8601 Timberhallow Ct", "",
                                "Louisville", "KY", 40219);    // Test Address 8

            //Test Date: Parcels
            _upvTest.AddLetter(_upvTest.AddressAt(0), _upvTest.AddressAt(2), 1.50M);                                                      // Test Letter 1
            _upvTest.AddLetter(_upvTest.AddressAt(2), _upvTest.AddressAt(4), 1.25M);                                                      // Test Letter 2
            _upvTest.AddLetter(_upvTest.AddressAt(4), _upvTest.AddressAt(0), 1.75M);                                                      // Test Letter 3
            _upvTest.AddGroundPackage(_upvTest.AddressAt(5), _upvTest.AddressAt(6), 3, 6, 9, 12);                                         // Test GroundPackage 1
            _upvTest.AddGroundPackage(_upvTest.AddressAt(4), _upvTest.AddressAt(7), 12, 9, 6, 3);                                         // Test GroundPackage 2
            _upvTest.AddGroundPackage(_upvTest.AddressAt(3), _upvTest.AddressAt(7), 6, 7, 9, 100);                                        // Test GroundPackage 3
            _upvTest.AddNextDayAirPackage(_upvTest.AddressAt(4), _upvTest.AddressAt(7), 500, 12, 12, 12, 12);                             // Test NextDayAirPackage 1
            _upvTest.AddNextDayAirPackage(_upvTest.AddressAt(7), _upvTest.AddressAt(2), 20, 7, 7, 7, 70);                                 // Test NextDayAirPackage 2
            _upvTest.AddNextDayAirPackage(_upvTest.AddressAt(1), _upvTest.AddressAt(4), 5, 1, 2, 3, 4);                                   // Test NextDayAirPackage 3
            _upvTest.AddTwoDayAirPackage(_upvTest.AddressAt(3), _upvTest.AddressAt(6), 9, 9, 9, 200, TwoDayAirPackage.Delivery.Saver);    //Test TwoDayAirPackage 1
            _upvTest.AddTwoDayAirPackage(_upvTest.AddressAt(6), _upvTest.AddressAt(1), 10, 20, 30, 40, TwoDayAirPackage.Delivery.Early);  //Test TwoDayAirPackage 2
            _upvTest.AddTwoDayAirPackage(_upvTest.AddressAt(1), _upvTest.AddressAt(6), 100, 90, 80, 76, TwoDayAirPackage.Delivery.Saver); //Test TwoDayAirPackage 3

            InitializeComponent();
        }
Пример #14
0
        UserParcelView testa = new UserParcelView();            //UPV object

        //Precondition: None
        //Postcondition: The Prog2Form is initialized with test data
        public Prog2Form()
        {
            InitializeComponent();
            testa.AddAddress("John Jacob", "112 Oakland Ave", "", "Louisville", "KY", 40204);
            testa.AddAddress("Jingle Hymersmith", "555 Rhinehard Ln", "Apt. 9", "Aville", "WV", 12345);
            testa.AddAddress("Aberdee Z", "12 Baxter", "Unit 100", "Aplace", "NY", 67895);
            testa.AddAddress("Aye Person", "Pirate Cove", "", "Dangertown", "CA", 55555);
            testa.AddAddress("Luke Elwalker", "Rebelscum St", "", "Dagoba", "VA", 22553);
            testa.AddAddress("Grown Man", "2234 Hisown Pl", "Apt. 9 3/4", "Avillage", "KY", 05551);
            testa.AddLetter(testa.AddressAt(0), testa.AddressAt(1), 12.95M);
            testa.AddLetter(testa.AddressAt(2), testa.AddressAt(3), 2.99M);
            testa.AddLetter(testa.AddressAt(4), testa.AddressAt(5), 55.98M);
            testa.AddGroundPackage(testa.AddressAt(2), testa.AddressAt(3), 12, 23, 12, 100);
            testa.AddNextDayAirPackage(testa.AddressAt(4), testa.AddressAt(2), 19, 23, 5, 23, 22.01M);
        }