Exemplo n.º 1
0
        /// <summary>
        /// Updates the object.
        /// </summary>
        /// <param name="bench">The bench.</param>
        /// <param name="seatIDs">The seatIDs.</param>
        /// <returns>The same bench</returns>
        public BenchViewModel UpdateObject(BenchViewModel bench, Collection<int> seatIDs)
        {
            Collection<SeatViewModel> svmList = bench.SeatList;

            SeatFactory sf = new SeatFactory();
            foreach (int seatID in seatIDs)
            {
                if (!bench.HasSeat(seatID))
                {
                    SeatViewModel svm = sf.CreateNewObject(seatID);
                    svmList.Add(svm);
                }
            }

            bench.SetSeats();
            return bench;
        }
Exemplo n.º 2
0
 public void SetUp()
 {
     factory = new SeatFactory();
 }