示例#1
0
 public void RetrieveSupplierApplicationWorkingTest() // ☑
 {
     supplierAppID            = "100";
     testSupplierAppRetrieval = SupplierMang.RetrieveSupplierApplication(supplierAppID);
     Assert.IsNotNull(testSupplierAppRetrieval);
     TestCleanupAccessor.deleteTestApplication();
 }
示例#2
0
        public void RetrieveSupplierApplicationListTest() // ☑
        {
            List <SupplierApplication> suppliersApps = SupplierMang.RetrieveSupplierApplicationList();

            Assert.IsNotNull(suppliersApps);
            TestCleanupAccessor.deleteTestApplication();
        }
示例#3
0
        public void AddSupplierApplicationNullTest() // ☑
        {
            SupplierApplication SupplierAppNull = null;

            SupplierMang.AddASupplierApplication(SupplierAppNull);
            TestCleanupAccessor.deleteTestApplication();
        }
示例#4
0
 public void RetrieveSupplierApplicationNullIDTest() // ☑
 {
     supplierAppID            = null;
     testSupplierAppRetrieval = SupplierMang.RetrieveSupplierApplication(supplierAppID);
     Assert.IsNull(testSupplierAppRetrieval);
     TestCleanupAccessor.deleteTestApplication();
 }
示例#5
0
 public void AddSupplierApplicationWorkingTest() // ☑
 {
     Setup("AddAppWorkingTest");
     SupplierMang.AddASupplierApplication(testSupplierApp);
     TestCleanupAccessor.DeleteTestSupplier(testSupplier);
     TestCleanupAccessor.deleteTestApplication();
 }
示例#6
0
        public void InvoiceAccessorArchiveGuestInvoice()
        {   //Archives the fake guest invoice
            int id     = TestCleanupAccessor.GetHotelGuest();
            int worked = access.ArchiveGuestInvoice(id);

            Assert.AreEqual(2, worked);
        }
示例#7
0
        public void TestCancelBookingResults()
        {
            //Tests the Cancel Booking Results method in the Booking Manager- which takes a BookingDetails object.
            //Grabs the ID for the dummy booking
            int id = TestCleanupAccessor.GetBooking();
            //retrieves the full booking information
            Booking booking1 = myBook.RetrieveBooking(id);

            //Creates a BookingDetails object and assigns variables from the booking to it.
            bookingDetails               = new BookingDetails();
            bookingDetails.BookingID     = id;
            bookingDetails.GuestID       = guestID;
            bookingDetails.EmployeeID    = empID;
            bookingDetails.ItemListID    = itemID;
            bookingDetails.Quantity      = bQuantity;
            bookingDetails.DateBooked    = dateBooked;
            bookingDetails.TicketPrice   = ticket;
            bookingDetails.ExtendedPrice = extended;
            bookingDetails.Discount      = discount;
            bookingDetails.TotalCharge   = total;
            //Passes the object to the CancelBookingResults method and asserts that that cancel will be successful
            ResultsEdit result   = myBook.CancelBookingResults(bookingDetails);
            ResultsEdit expected = ResultsEdit.Success;

            Assert.AreEqual(expected, result);
        }
示例#8
0
        public void AddSupplierApplicationEmptyTest() // ☑
        {
            SupplierApplication SupplierAppEmpty = new SupplierApplication();

            SupplierMang.AddASupplierApplication(SupplierAppEmpty);
            TestCleanupAccessor.deleteTestApplication();
        }
示例#9
0
 public void AddSupplierPartialTest() //☑
 {
     Setup("Partial Test");
     testSupplier.Zip      = null;
     testSupplier.LastName = null;
     Assert.AreEqual(SupplierMang.AddANewSupplier(testSupplier, "Test"), SupplierResult.DatabaseError);
     TestCleanupAccessor.DeleteTestSupplier(testSupplier);
 }
示例#10
0
        public void InvoiceManagerArchiveGuestInvoice()
        {
            int            guestID  = TestCleanupAccessor.GetHotelGuest();
            ResultsArchive result   = access.ArchiveGuestInvoice(guestID);
            ResultsArchive expected = ResultsArchive.Success;

            Assert.AreEqual(expected, result);
        }
示例#11
0
        public void AddEventType_Valid()
        {
            setup();

            Assert.AreEqual(1, EventTypeAccessor.AddEventType("Test"));

            TestCleanupAccessor.DeleteEventTypeTest(eventTypeToTest);
        }
示例#12
0
        public void AddSupplierNullTest() // ☑
        {
            Supplier testSupplierNull = new Supplier();

            testSupplierNull = null;
            Assert.AreEqual(SupplierMang.AddANewSupplier(testSupplierNull, "Test"), SupplierResult.DatabaseError);
            TestCleanupAccessor.DeleteTestSupplier(testSupplierNull);
        }
示例#13
0
        public void AddSupplierEmptyTest() // ☑
        {
            //test 1 empty Supplier
            Supplier testSupplierEmpty = new Supplier();

            Assert.AreEqual(SupplierMang.AddANewSupplier(testSupplierEmpty, "Test"), SupplierResult.DatabaseError);
            TestCleanupAccessor.DeleteTestSupplier(testSupplierEmpty);
        }
示例#14
0
        public void EmployeeGetEmployeeByIDAccess()
        {
            //Grab the fake employeeID number
            int ID = TestCleanupAccessor.getTestEmp();
            //Callls to Employee Accessor to grab an employee record by id
            Employee fake = EmployeeAccessor.GetEmployee(ID);

            Assert.AreEqual("Test", fake.FirstName);
        }
示例#15
0
        public void TestGetBookingbyIDAccess()
        {   // Retrieves a booking from the database by ID, first captures the dummy booking from database
            //using a TestAccessor, then uses a real accessor method to be tested.
            BookingID = TestCleanupAccessor.GetBooking();
            Booking booking2 = BookingAccessor.GetBooking(BookingID);
            decimal expected = 1234;

            Assert.AreEqual(expected, booking2.TicketPrice);
        }
示例#16
0
        public void HotelAccessorAdd()
        {
            int changed = HotelGuestAccessor.HotelGuestAdd(new HotelGuest("Fake", "Person", "1111 Fake St.", "", new CityState("52641", "Mt. Pleasant", "IA"), "5556667777", "*****@*****.**", "234234234", "3456", true));

            //This line below must remain here, helps to properly track and delete invoice, which is linked to Guest record
            TestCleanupAccessor.ClearOutInvoice();
            //Asserts that the update has been made
            Assert.AreEqual(2, changed);
        }
示例#17
0
        public void EmployeeGetEmployeeLoginAccess()
        {
            //Grabs the fake emp ID
            int      ID   = TestCleanupAccessor.getTestEmp();
            Employee fake = EmployeeAccessor.GetEmployeeLogin(ID, Password);

            //Asserts that the employee record being returned matches the fake employee record in the setup
            Assert.AreEqual("Test", fake.FirstName);
        }
示例#18
0
        public void HotelAccessorGet()
        {
            //calls generic Test accessor to grab the guestID
            int guestID = TestCleanupAccessor.GetHotelGuest();
            //Calls to the accessor method
            List <HotelGuest> guest = HotelGuestAccessor.HotelGuestGet(guestID);

            //Asserts that the firstname of the in the list corresponds to the dummy record first name
            Assert.AreEqual("Fake", guest[guest.Count - 1].FirstName);
        }
示例#19
0
        public void Cleanup()
        {
            SupplierLoginManager myMan = new SupplierLoginManager();

            ItemListingAccessor.DeleteItemListingTestItem(itemListingToTest);
            testSupp.SupplierID = modSupp.SupplierID;
            testLog             = myMan.RetrieveSupplierLogin("Password#1", "Test");
            TestCleanupAccessor.DeleteTestSupplierLogin(testLog);
            TestCleanupAccessor.DeleteTestSupplier(testSupp);
        }
示例#20
0
        public void AddSupplierWorkingTest() // ☑
        {
            Setup("AddWorkingTest");
            Assert.AreEqual(SupplierMang.AddANewSupplier(testSupplier, "Test"), SupplierResult.Success);
            findTestItemDetails();

            testLog = sLA.RetrieveSupplierLogin("Password#1", "Test");
            TestCleanupAccessor.DeleteTestSupplierLogin(testLog);
            TestCleanupAccessor.DeleteTestSupplier(testSupplier);
        }
示例#21
0
        public void UpdateEventType_Valid()
        {
            setup();

            EventTypeAccessor.AddEventType("Test");
            eventTypeToTest = getEventTypeID(list);

            Assert.AreEqual(1, EventTypeAccessor.UpdateEventType(eventTypeToTest, eventTypeToEdit));

            TestCleanupAccessor.DeleteEventTypeTest(eventTypeToEdit);
        }
示例#22
0
        public void EmployeeUpdateEmployeeAccess()
        {   //Grabs the fake emp ID
            int ID = TestCleanupAccessor.getTestEmp();
            //Grabs the entire Employee record from Accessor
            Employee orig = EmployeeAccessor.GetEmployee(ID);
            //Creates the new employee record with all of the original, changes the active property to false.
            Employee newEmp  = new Employee(orig.FirstName, orig.LastName, orig.Password, (int)orig.Level, false);
            int      changed = EmployeeAccessor.UpdateEmployee(orig, newEmp);

            //Asserts that the update went through with one row affected.
            Assert.AreEqual(1, changed);
        }
示例#23
0
        public void AddSupplierApplicationPartialTest() // ☐
        {
            SupplierApplication testSupplierApp2 = new SupplierApplication();

            testSupplierApp2.ApplicationDate    = new DateTime();
            testSupplierApp2.CompanyDescription = "test";
            testSupplierApp2.CompanyName        = "name";
            testSupplierApp2.PhoneNumber        = "234-234-2341";
            testSupplierApp2.FirstName          = "test";
            SupplierMang.AddASupplierApplication(testSupplierApp2);
            TestCleanupAccessor.deleteTestApplication();
        }
示例#24
0
        public void HotelAccessorUpdate()
        {
            //gets the guestID from the Test accessor
            int guestID = TestCleanupAccessor.GetHotelGuest();
            //passes guestID to the HotelGuestAccessor method to grab the guest.
            List <HotelGuest> guest = HotelGuestAccessor.HotelGuestGet(guestID);
            int hotelGuest          = guest.Count - 1;

            guest.Add(new HotelGuest((int)guest[hotelGuest].HotelGuestID, guest[hotelGuest].FirstName, guest[hotelGuest].LastName, guest[hotelGuest].Address1, guest[hotelGuest].Address2, guest[hotelGuest].CityState, guest[hotelGuest].PhoneNumber, guest[hotelGuest].EmailAddress, guest[hotelGuest].Room, guest[hotelGuest].GuestPIN, false));
            int changed = HotelGuestAccessor.HotelGuestUpdate(guest[guest.Count - 2], guest[hotelGuest]);

            Assert.AreEqual(1, changed);
        }
示例#25
0
        public void HotelManagerUpdate()
        {
            ResultsEdit changed = access.AddHotelGuest(TestGuest);
            //locates the fake record ID
            int guestID = TestCleanupAccessor.GetHotelGuest();
            //pulls from real manager
            HotelGuest guest = access.GetHotelGuest(guestID);
            //assigns a new value in guest2
            HotelGuest guest2 = new HotelGuest(guest.FirstName, "Individual", guest.Address1, guest.Address2, guest.CityState, guest.PhoneNumber, guest.EmailAddress, guest.Room, guest.GuestPIN, guest.Active);
            //calls to manager to complete update
            ResultsEdit edited = access.UpdateHotelGuest(guest, guest2);

            Assert.AreEqual(ResultsEdit.Success, edited);
        }
示例#26
0
        public void TestUpdateBookingAccess()
        {   // Updates the dummy booking in the database, first captures the dummy bookingID from database
            //using a TestAccessor
            BookingID = TestCleanupAccessor.GetBooking();
            //Assigns one booking object to be the old record and one to be the new record
            Booking old  = BookingAccessor.GetBooking(BookingID);
            Booking newB = new Booking(guestID, empID, itemID, 3, dateBooked, ticket, extended, discount, total);
            //Updates the old with the new quantity
            int rows     = BookingAccessor.UpdateBooking(old, newB);
            int expected = 3;
            //Grabs the record to test and see if the update went through
            Booking toCheck = BookingAccessor.GetBooking(BookingID);

            Assert.AreEqual(expected, toCheck.Quantity);
        }
示例#27
0
        public void EditSupplierworkingTest() // ☑
        {
            Setup("EditSupWorking");
            SupplierMang.AddANewSupplier(testSupplier, "Test");
            SupplierLoginManager newMan = new SupplierLoginManager();

            findTestItemDetails();
            Supplier testSupplier2 = test2();

            Assert.AreEqual(SupplierMang.EditSupplier(testSupplier, testSupplier2), SupplierResult.Success);

            testLog = newMan.RetrieveSupplierLogin("Password#1", "Test");
            TestCleanupAccessor.DeleteTestSupplierLogin(testLog);
            TestCleanupAccessor.DeleteTestSupplier(testSupplier);
        }
示例#28
0
        public void ArchiveSupplierWorkingTest() // ☑
        {
            Setup("EditSupWorking");
            SupplierMang.AddANewSupplier(testSupplier, "Test");
            SupplierLoginManager newMan = new SupplierLoginManager();

            findTestItemDetails();

            Assert.AreEqual(SupplierMang.ArchiveSupplier(testSupplier), SupplierResult.Success);
            SupplierLogin fake = new SupplierLogin();

            fake.UserName = "******";
            TestCleanupAccessor.DeleteTestSupplierLogin(fake);
            TestCleanupAccessor.DeleteTestSupplier(testSupplier);
        }
示例#29
0
        public void TestEditBooking()
        {
            // Updates the dummy booking in the database, first captures the dummy bookingID from database
            //using a TestAccessor
            BookingID = TestCleanupAccessor.GetBooking();
            //Assigns one booking object to be the old record and one to be the new record
            Booking newB = myBook.RetrieveBooking(BookingID);

            //Updates the booking with new quantity
            newB.Quantity = 3;
            int rows     = myBook.EditBooking(newB);
            int expected = 3;
            //Grabs the record to test and see if the update went through
            Booking toCheck = myBook.RetrieveBooking(BookingID);

            Assert.AreEqual(expected, toCheck.Quantity);
        }
示例#30
0
        public void AddItemListing_ValidItemListing()
        {
            int expected = 1;

            setup();

            SupplierAccessor.AddSupplier(testSupp, "Test", "Password#1");
            modSupp = getSupplierListCompName(suppList);
            itemListingToTest.SupplierID = modSupp.SupplierID;

            int actual = ItemListingAccessor.AddItemListing(itemListingToTest);

            ItemListingAccessor.DeleteItemListingTestItem(itemListingToTest);
            testSupp.SupplierID = modSupp.SupplierID;
            testLog             = sLA.RetrieveSupplierLogin("Password#1", "Test");
            SupplierLoginAccessor.DeleteTestSupplierLogin(testLog);
            TestCleanupAccessor.DeleteTestSupplier(testSupp);

            Assert.AreEqual(expected, actual);
        }