public void SortTownByNameDescending()
        {
            var data = new List <Town>
            {
                new Town {
                    Name = "TownC"
                },
                new Town {
                    Name = "TownA"
                },
                new Town {
                    Name = "TownB"
                },
            }.AsQueryable();

            var mockSet = new Mock <DbSet <Town> >();

            mockSet.As <IQueryable <Town> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Town> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Town> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Town> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());

            var mockContext = new Mock <CarDealershipContext>();

            mockContext.Setup(m => m.Towns).Returns(mockSet.Object);

            var service    = new TownBusiness(mockContext.Object);
            var TownsFound = service.SortTownsByNameDescending();

            Assert.AreEqual(3, TownsFound.Count());
            Assert.AreEqual("TownC", TownsFound[0].Name);
            Assert.AreEqual("TownB", TownsFound[1].Name);
            Assert.AreEqual("TownA", TownsFound[2].Name);
        }
        /// <summary>
        /// Populate the data grid with information sorted by towns' name in descending order
        /// </summary>
        private void PopulateDataGridViewSortTownsByNameDescending()
        {
            dataGridView.Rows.Clear();
            TownBusiness townBusiness = new TownBusiness();
            var          townList     = townBusiness.SortTownsByNameDescending();

            DataPopulator(townList);
        }