public void Get_All_Tickets_Test()
        {
            mock.Setup(x => x.Get_All_Tickets()).Returns(tickets);
            var controller = new TicketController(mock.Object);
            var res        = controller.Get_All_Tickets() as OkObjectResult;

            Assert.AreEqual(200, res.StatusCode);
            Assert.IsInstanceOf <List <Ticket> >(res.Value);
        }
Example #2
0
        public void Get_All_Tickets__Success_Test()
        {
            controller = new TicketController(ticketrepo);
            var res = controller.Get_All_Tickets() as OkObjectResult;

            Assert.IsNotNull(res);
            Assert.AreEqual(200, res.StatusCode);
            Assert.IsInstanceOf <List <Ticket> >(res.Value);
        }