Esempio n. 1
0
        public void NumToMonth_Test()
        {
            // ARRANGE
            SpaceDAO spaceDAO = new SpaceDAO(connectionString);
            string   monthNum = "1";

            // ACT
            string result = spaceDAO.NumToMonth(monthNum);

            // ASSERT
            Assert.AreEqual("Jan.", result);
        }
Esempio n. 2
0
        public void GetSpaces_Test()
        {
            // ARRANGE
            SpaceDAO spaceDAO        = new SpaceDAO(connectionString);
            int      selectedVenueId = 267;
            bool     found           = false;

            // ACT
            IList <Space> listOfSpaces = spaceDAO.GetSpaces(selectedVenueId);

            foreach (Space space in listOfSpaces)
            {
                if (space.id == 999)
                {
                    found = true;
                    break;
                }
            }

            // ASSERT
            Assert.IsTrue(found);
        }
Esempio n. 3
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();
        }