Exemple #1
0
        public void delete_post_returns_json()
        {
            //Arrange
            _serv       = new Mock <IEmployerService>();
            _controller = new EmployerController(_serv.Object, _defaults.Object, map, _adaptor.Object);

            //Act
            var result = _controller.Delete(testId, "UnitTest");

            //Assert
            Assert.AreEqual("{ status = OK, jobSuccess = True, deletedID = 4242 }",
                            result.Value.ToString());
        }
Exemple #2
0
        public void delete_post_returns_json()
        {
            //Arrange
            serv = new Mock <IEmployerService>();
            var fakeform = new FormCollection();

            woServ = new Mock <IWorkOrderService>();
            ctrlr  = new EmployerController(serv.Object, def.Object, map);
            ctrlr.SetFakeControllerContext();
            ctrlr.ValueProvider = fakeform.ToValueProvider();
            //Act
            var result = ctrlr.Delete(Testid, "UnitTest");

            //Assert
            Assert.AreEqual("{ status = OK, jobSuccess = True, deletedID = 4242 }",
                            result.Data.ToString());
        }