Exemplo n.º 1
0
        public ActionResult Indexc()
        {
            Arrival newItem = new Arrival(Request.Form["new-arrival"]);

            newItem.Save();
            List <Arrival> allItems = Arrival.GetAll();

            return(View("arrivalc", allItems));
        }
Exemplo n.º 2
0
        public void GetAll_ReturnsEmptyList_ArrivalList()
        {
            //Arrange
            List <Arrival> newList = new List <Arrival> {
            };

            //Act
            List <Arrival> result = Arrival.GetAll();

            //Assert
            CollectionAssert.AreEqual(newList, result);
        }
Exemplo n.º 3
0
        public void Save_SavesToDatabase_ArrivalList()
        {
            //Arrange
            Arrival testArrival = new Arrival("Mow the lawn");

            //Act
            testArrival.Save();
            List <Arrival> result   = Arrival.GetAll();
            List <Arrival> testList = new List <Arrival> {
                testArrival
            };

            //Assert
            CollectionAssert.AreEqual(testList, result);
        }
Exemplo n.º 4
0
        public void Save_AssignsIdToObject_Id()
        {
            //Arrange
            Arrival testArrival = new Arrival("Mow the lawn");

            //Act
            testArrival.Save();
            Arrival savedArrival = Arrival.GetAll()[0];

            int result = savedArrival.Id;
            int testId = testArrival.Id;

            //Assert
            Assert.AreEqual(testId, result);
        }
Exemplo n.º 5
0
        public void GetAll_ReturnsArrivals_ArrivalList()
        {
            //Arrange
            string  city01      = "Walk the dog";
            string  city02      = "Wash the dishes";
            Arrival newArrival1 = new Arrival(city01);

            newArrival1.Save();
            Arrival newArrival2 = new Arrival(city02);

            newArrival2.Save();
            List <Arrival> newList = new List <Arrival> {
                newArrival1, newArrival2
            };

            //Act
            List <Arrival> result = Arrival.GetAll();

            //Assert
            CollectionAssert.AreEqual(newList, result);
        }
Exemplo n.º 6
0
        public ActionResult Displaycategory()
        {
            List <Arrival> allItems = Arrival.GetAll();

            return(View("arrivalc", allItems));
        }
Exemplo n.º 7
0
        public ActionResult Searcharrivals()
        {
            List <Arrival> allItems = Arrival.GetAll();

            return(View(allItems));
        }
Exemplo n.º 8
0
        public ActionResult Createdeparture()
        {
            List <Arrival> allItems = Arrival.GetAll();

            return(View(allItems));
        }