BinaryStudio.ClientManager.WebUi.Controllers.EmployeesController.Index C# (CSharp) Method

Index() public method

public Index ( ) : System.Web.Mvc.ViewResult
return System.Web.Mvc.ViewResult
        public ViewResult Index()
        {
            return View(repository.Query<Person>().ToList().Where(x=>x.Role==PersonRole.Employee).AsQueryable());
        }

Usage Example

        public void ShouldNot_RiseException_WhenListOfEmployeeIsEmpty()
        {
            //arrange
            var repository = Substitute.For<IRepository>();
            repository.Query<Person>().Returns(new List<Person>().AsQueryable());

            var employeesController = new EmployeesController(repository);

            //act
            employeesController.Index();

            //assert
            Assert.Pass();
        }
All Usage Examples Of BinaryStudio.ClientManager.WebUi.Controllers.EmployeesController::Index