Exemplo n.º 1
0
        public void GetSites_ReturnTopFive()
        {
            //Arrange
            SiteSQLDAO dao = new SiteSQLDAO(this.connectionString);

            ReservationSQLDAO Rdao = new ReservationSQLDAO(this.connectionString);

            IList <Site> list = dao.GetSites(DateTime.Parse("06/06/2019"), DateTime.Parse("06/07/2019"), CampgroundID);

            int listCountBefore = list.Count;

            //Act
            Rdao.AddReservation(SiteId, "Patt", DateTime.Parse("06/06/2019"), DateTime.Parse("06/07/2019"));

            list = dao.GetSites(DateTime.Parse("06/06/2019"), DateTime.Parse("06/07/2019"), CampgroundID);

            int listCountAfter = list.Count;

            //Assert
            Assert.AreEqual(listCountBefore - 1, listCountAfter);
        }
Exemplo n.º 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();
        }