示例#1
0
        public void EmployeeEntity_Details_WithUnavailableId()
        {
            var controller = new EmployeeEntityController();

            HttpNotFoundResult result = controller.Details(int.MaxValue) as HttpNotFoundResult;

            Assert.AreEqual((int)HttpStatusCode.NotFound, result.StatusCode);
        }
示例#2
0
        public void EmployeeEntity_Details_WithNull()
        {
            var controller = new EmployeeEntityController();

            HttpStatusCodeResult result = controller.Details(null) as HttpStatusCodeResult;

            Assert.AreEqual((int)HttpStatusCode.BadRequest, result.StatusCode);
        }
示例#3
0
        public void EmployeeEntity_Details_WithAvailableId()
        {
            var controller = new EmployeeEntityController();

            int        expectedId = 1;
            ViewResult result     = controller.Details(expectedId) as ViewResult;
            int        id         = (result.Model as Employee).Id;

            Assert.AreEqual(expectedId, id);
        }