示例#1
0
        /// <summary>
        /// True iff was able to assign customer to that seat.
        /// False otherwise
        /// </summary>
        /// <param name="seat">Desired seat assignment</param>
        /// <param name="customer">Customer to be assigned</param>
        /// <returns>True iff was able to assign customer to that seat.
        /// False otherwise</returns>
        public bool AssignCustomerToSeat(string seat, string customer)
        {
            // validate customer is not empty
            if (String.IsNullOrWhiteSpace(customer))
            {
                return(false);
            }

            // validate seat input

            if (IsInvalidSeat(seat))
            {
                return(false);
            }

            return(ap.AssignSeatTo(seat, customer));
        }
示例#2
0
        public void AssignEmptySeat_ReturnsTrue()
        {
            // Assemble
            string customer = "John Doe";
            string seat     = "1A";

            // act
            Assert.IsTrue(ap.AssignSeatTo(seat, customer));
        }