public void NavBar_Return_IsNotNullModel() { //Arrange var navbar = new NavbarController(); string controller = "Home"; string act = "Index"; //Act var result = navbar.Navbar(controller, act) as PartialViewResult; //Assert Assert.IsNotNull(result); }
public void NavBar_Return_TypeModel() { //Arrange var navbar = new NavbarController(); string controller = "Home"; string act = "Index"; //Act var result = navbar.Navbar(controller, act) as PartialViewResult; //Assert Assert.IsInstanceOfType(result.Model, typeof(List <Navbar>)); }
public void NavBar_Return_ViewResult() { //Arrange var navbar = new NavbarController(); string controller = "Home"; string act = "Index"; //Act var result = navbar.Navbar(controller, act); //Assert Assert.IsInstanceOfType(result, typeof(PartialViewResult)); }
public void NavBar_Return_WithItems() { //Arrange var navbar = new NavbarController(); string controller = "Home"; string act = "Index"; //Act var result = navbar.Navbar(controller, act) as PartialViewResult; var list = (IEnumerable <Navbar>)result.Model; //Assert Assert.AreNotEqual(0, list.Count()); }
public void NavBar_Return_SameModel() { //Arrange var navbar = new NavbarController(); var navbars = new List <Navbar>(); navbars.Add(new Navbar { Id = 2, nameOption = "Charts", controller = "Home", action = "Charts", imageClass = "fa fa-fw fa-bar-chart-o", estatus = true }); navbars.Add(new Navbar { Id = 3, nameOption = "Tables", controller = "Home", action = "Tables", imageClass = "fa fa-fw fa-table", estatus = true }); string controller = "Home"; string act = "Index"; //Act var viewResult = navbar.Navbar(controller, act) as PartialViewResult; var viewModel = viewResult.Model; //Assert Assert.AreSame(viewResult.Model.ToString(), navbars.ToString()); }