Exemple #1
0
 public void Setup()
 {
     trans    = new TransactionScope();
     venueDAO = new VenueDAO(connectionString);
     spaceDAO = new SpacesDAO(connectionString);
     resDAO   = new ReservationDAO(connectionString);
 }
Exemple #2
0
 public UserInterface(string connectionString)
 {
     this.connectionString = connectionString;
     venueDAO = new VenueDAO(connectionString);
     spaceDAO = new SpacesDAO(connectionString);
     resDAO   = new ReservationDAO(connectionString);
 }
Exemple #3
0
        public void ListVenue_Test()
        {
            // ARRANGE
            VenueDAO venueDAO     = new VenueDAO(connectionString);
            int      usersVenueId = 267;

            //ACT
            Venue result = venueDAO.ListVenue(usersVenueId);

            //ASSERT
            Assert.AreEqual("Cigar Party Palace", result.name);
        }
Exemple #4
0
        public void GetVenues_Test()
        {
            //ARRANGE
            VenueDAO venueDAO = new VenueDAO(connectionString);
            bool     found    = false;


            //ACT
            IList <Venue> venues = venueDAO.GetVenues();

            foreach (Venue venue in venues)
            {
                if (venue.id == 267)
                {
                    found = true;
                    break;
                }
            }

            //ASSERT
            Assert.IsTrue(found);
        }
Exemple #5
0
        static void Main(string[] args)
        {
            #region call to appsettings.json for configuration
            // 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();
            #endregion

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

            // Create a new object of type VenueDAO so that we can pass it into the User Interface.
            IVenueDAO venueDAO = new VenueDAO(connectionString);
            // Create a new object of type SpaceDAO so that we can pass it into the User Interface.
            ISpaceDAO spaceDAO = new SpaceDAO(connectionString);
            // Create a new object of type ReservationDAO so that we can pass it into the User Interface.
            IReserveDAO reserveDAO = new ReservationDAO(connectionString);

            UserInterface ui = new UserInterface(connectionString, venueDAO, spaceDAO, reserveDAO);
            ui.Run();
        }