Ejemplo n.º 1
0
        protected override void SetMenuOptions()
        {
            IList <Park> parkList = parkObj.GetAllParks();
            int          i        = 1;

            foreach (Park park in parkList)
            {
                menuOptions.Add(i.ToString(), park.Name);
                i++;
            }
            this.menuOptions.Add("Q", "Quit program");
        }
Ejemplo n.º 2
0
        protected override void SetMenuOptions()
        {
            // Displays all parks and allows the user to select them
            IList <Park> parkList = parkObj.GetAllParks();
            int          i        = 1;

            foreach (Park park in parkList)
            {
                menuOptions.Add(i.ToString(), park.Name);
                i++;
            }
            this.menuOptions.Add("Q", "Quit program");
        }
        public void GetParksReturnsOnePark()
        {
            ParkSqlDAO   parkDAO = new ParkSqlDAO(ConnectionString);
            IList <Park> parks   = parkDAO.GetAllParks();

            Assert.AreEqual(1, parks.Count);
        }
Ejemplo n.º 4
0
        public void GetAllParks_ShouldReturn_1_Park()
        {
            ParkSqlDAO   dao   = new ParkSqlDAO(ConnectionString);
            IList <Park> parks = dao.GetAllParks();

            Assert.AreEqual(1, parks.Count);
        }
Ejemplo n.º 5
0
        public void GetParks()
        {
            ParkSqlDAO dao = new ParkSqlDAO(connectionString);

            IList <Park> list = dao.GetAllParks();

            Assert.AreEqual(1, list.Count);
        }
        public void GetParks_AllParksShouldReturn()
        {
            ParkSqlDAO parkSqlDAO = new ParkSqlDAO(ConnectionString);

            IList <Park> parks = parkSqlDAO.GetAllParks();

            Assert.IsTrue(parks.Count > 0);
        }
        public void TestOnePark()
        {
            ParkSqlDAO dao = new ParkSqlDAO(connString);

            IList <Park> test = dao.GetAllParks();

            Assert.AreEqual(1, test.Count);
        }
Ejemplo n.º 8
0
        public void GetAllParks()
        {
            List <Park> parks = DAO.GetAllParks();

            Assert.AreEqual(10, parks.Count, "There should be 10 parks.");
            Assert.AreEqual(parks[0].ParkName, "Cuyahoga Valley National Park", "Parks should be alphabetical");
            Assert.AreEqual(parks[9].ParkName, "Yosemite National Park", "Parks should be alphabetical");
            Assert.IsFalse(parks.Contains(null), "All parks should have information");
        }
        public void GetAllParks_ShouldReturn1()
        {
            //Arrange
            ParkSqlDAO dao = new ParkSqlDAO(ConnectionString);
            //Act
            IList <Park> output = dao.GetAllParks();

            //Assert
            Assert.AreEqual(1, output.Count);
        }
        public void GetAllParksTest()
        {
            // Arrange
            ParkSqlDAO dao = new ParkSqlDAO(connectionString);

            // Act
            IList <Park> actual = dao.GetAllParks();

            // Assert
            Assert.AreEqual(2, actual.Count);
        }
        public void ParkListPopulatesWith2Parks()
        {
            IParkSqlDAO dao = new ParkSqlDAO(connectionString);

            IList <Park> parkList = dao.GetAllParks();

            int parkCount = parkList.Count;


            Assert.AreEqual(2, parkCount);
        }
        public void GetAllParksTest()
        {
            // Arrange
            IList <Park> parks;
            IParkDAO     dao = new ParkSqlDAO(connection);

            // Act
            parks = dao.GetAllParks();

            // Assert
            Assert.AreEqual(3, parks.Count);
        }
Ejemplo n.º 13
0
        public void GetAllParksReturnsOnePark()
        {
            //Arrange
            ParkSqlDAO   parkDao = new ParkSqlDAO(ConnectionString);
            IList <Park> parks   = new List <Park>();

            //Act - Get a list of parks that should be 1 based on test data
            parks = parkDao.GetAllParks();

            //Assert
            Assert.AreEqual(1, parks.Count);
        }
Ejemplo n.º 14
0
        public void GetCountOfParks()
        {
            // Arrange
            IParkDAO dao = new ParkSqlDAO(connectionString);

            // Act
            IList <Park> parks = dao.GetAllParks();

            // Assert
            // Our test database has one park
            Assert.AreEqual(1, parks.Count);
        }
Ejemplo n.º 15
0
        public void GetParksTest_Should_ReturnAllParksInLocationAlphaOrder()
        {
            // Arrange
            ParkSqlDAO dao = new ParkSqlDAO(ConnectionString);

            // Act
            IList <Park> parks = dao.GetAllParks();

            // Assert
            Assert.AreEqual(2, parks.Count);
            Assert.AreEqual("Ohio", parks[0].Location);
            Assert.AreEqual("Pennsylvania", parks[1].Location);
        }
Ejemplo n.º 16
0
        public void GetAllParks_Test_ShouldReturnParks()
        {
            //Arrange
            ParkSqlDAO dao = new ParkSqlDAO(this.connectionString);
            //Act
            List <Park> list = new List <Park>();

            list = dao.GetAllParks();
            //Assert
            Assert.AreEqual(3, list.Count);
            Assert.AreEqual("Acadia", list[0].Name);
            Assert.AreEqual("Arches", list[1].Name);
            Assert.AreEqual("Cuyahoga Valley", list[2].Name);
        }
        public ViewParksMenu()
        {
            IParkSqlDAO parkDAO = new ParkSqlDAO(ConnectionString);

            try
            {
                this.Title = "***Select A Park For Further Details***";
                parkList   = parkDAO.GetAllParks();
                foreach (Park park in parkList)
                {
                    this.menuOptions.Add($"{park.Park_ID}", $"{park.Name}");
                }
                this.menuOptions.Add("Q", "Quit");
            }
            catch (Exception e)
            {
                Console.WriteLine($"There was an error: {e.Message}.");
            }
        }
        public void TestGetParks()
        {
            //Arrange
            ParkSqlDAO dao = new ParkSqlDAO(connectionString);

            //Act
            IList <Park> parks = dao.GetAllParks();
            int          i     = 0;

            for (; i < parks.Count; i++)
            {
                if (parks[i].ParkId == newParkId)
                {
                    break;
                }
            }

            //Assert
            Assert.AreEqual(2, parks.Count);
            Assert.AreEqual("Mount Rushmore", parks[i].Name);
        }