示例#1
0
        public void GetParks_ReturnAllParks()
        {
            //Arrange
            CampgroundSQLDAO dao = new CampgroundSQLDAO(this.connectionString);


            //Act
            IList <Campground> list = dao.GetCampgrounds(ParkId);

            //Assert
            Assert.AreEqual(1, list.Count);
        }
示例#2
0
        static void Main(string[] args)
        {
            // Get the connection string from the appsettings.json file
            IConfigurationBuilder builder = new ConfigurationBuilder()
                                            .SetBasePath(Directory.GetCurrentDirectory())
                                            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            IConfigurationRoot configuration = builder.Build();

            string connectionString = configuration.GetConnectionString("Project");

            ICampgroundDAO  campgroundDAO  = new CampgroundSQLDAO(connectionString);
            IParkDAO        parkDAO        = new ParkSQLDAO(connectionString);
            IReservationDAO reservationDAO = new ReservationSQLDAO(connectionString);
            ISiteDAO        siteDAO        = new SiteSQLDAO(connectionString);



            // Create a menu and run it
            ViewParksMenu menu = new ViewParksMenu(parkDAO, campgroundDAO, reservationDAO, siteDAO);

            menu.Run();
        }