Esempio n. 1
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");

            /********************************************************************
             * // If you do not want to use CLIMenu, you can remove the following
             *********************************************************************/
            // Create any DAOs needed here, and then pass them into main menu...
            IParkDAO        parkDAO        = new ParkSqlDao(connectionString);
            ICampgroundDAO  campgroundDAO  = new CampgroungSqlDAO(connectionString);
            IReservationDAO reservationDAO = new ReservationSqlDAO(connectionString);
            ISiteDAO        siteDAO        = new SiteSqlDAO(connectionString);

            MainMenu mainMenu = new MainMenu(parkDAO, campgroundDAO, reservationDAO, siteDAO);  // You'll probably be adding daos to the constructor

            // Run the menu.
            mainMenu.Run();
        }
Esempio n. 2
0
        public void GetAllCampgoundsTests()
        {
            // Arrange
            CampgroungSqlDAO dao = new CampgroungSqlDAO(connectionString);

            //Act
            IList <Campground> Project = dao.GetCampground(newcampground_id);

            //Assert

            // At least 1 Project
            Assert.IsTrue(Project.Count > 0);
        }