コード例 #1
0
        public void GetCampgroundListTest()
        {
            Park park = dal.GetParkList()[0];
            var  list = dal.GetCampgroundList(park);

            Assert.AreEqual(1, list.Count);
        }
コード例 #2
0
        /// <summary>
        /// Shows campgrounds list for given park with reservation cost and other options
        /// </summary>
        /// <param name="park">The current selected park</param>
        private void CampgroundDisplay(Park park)
        {
            Console.WriteLine("Search for Campground Reservation\n");
            Console.WriteLine("Name".PadRight(40) + "Open".PadRight(10) + "Close".PadRight(10) + "Daily Fee\n".PadRight(10));

            var camplist = dal.GetCampgroundList(park);
            int counter  = 0;

            foreach (Campground campground in camplist)
            {
                counter++;
                Console.WriteLine($"{counter}){campground.Name}".PadRight(40) +
                                  $"{MonthName(campground.OpenFromMonth)}".PadRight(10) +
                                  $"{MonthName(campground.OpenToMonth)}".PadRight(10) + $"{campground.DailyFee:C}".PadRight(10));
            }
        }