Exemplo n.º 1
0
        public void JobsController_DetailsPost()
        {
            //arrange
            Proposal model = new Proposal()
            {
                Id               = 1,
                PriceEst         = 2.20M,
                Message          = "a",
                AvailabilityDate = DateTime.Now,
                UserJob_Id       = 1,
                Technician_Id    = 1,
                UserSeen         = false,
                TechSeen         = false,
                Technician       = new Technician(),
                UserJob          = new UserJob()
            };

            JobsController controller = new JobsController(new FakeJobRepository());

            //act
            System.Web.Mvc.RedirectToRouteResult result = controller.Details(model) as System.Web.Mvc.RedirectToRouteResult;

            //assert
            Assert.IsNotNull(result);
        }
Exemplo n.º 2
0
        public void JobsController_Details()
        {
            //arrrange
            JobsController controller = new JobsController(new FakeJobRepository());

            //act
            System.Web.Mvc.ViewResult result = controller.Details(1) as System.Web.Mvc.ViewResult;

            //assert
            Assert.IsNotNull(result);
            UserJob resultModel = result.Model as UserJob;

            Assert.AreEqual(1, resultModel.Id);
        }