Beispiel #1
0
        /// <summary>
        /// Gets a list of all rents from db, sorts the list by member name and returns to view
        /// </summary>
        /// <returns>a list of all rents</returns>
        public ActionResult Index()
        {
            List <Rent>           rents = RentRepository.GetRents();
            SortRentsByMemberName sortRentsByMemberName = new SortRentsByMemberName();

            rents.Sort(sortRentsByMemberName);
            return(View(rents));
        }
Beispiel #2
0
        public void GetRents()
        {
            IEnumerable <Rent> rentsFr;

            using (var context = new RentMyCarContext(options))
            {
                var service = new RentRepository(context);
                rentsFr = service.GetRents(_userFr.UserName);
            }

            Assert.AreEqual(1, rentsFr.Count());
            Assert.AreEqual(_lambo.Model, rentsFr.FirstOrDefault().Car.Model);
        }