public void ListUsersToDeleteOrEdit_Should_Not_Return_Null() { //Arrange SysAdminController controller = new SysAdminController(moq.Object); //Act ViewResult vr = (ViewResult)controller.ListUsersToDeleteOrEdit("123456", "abc"); //Assert Assert.IsNotNull(vr); }
public void ListUsersToDeleteOrEdit_Test() { //arrange SysAdminController controller = new SysAdminController(moq.Object); //act ViewResult vr = (ViewResult)controller.ListUsersToDeleteOrEdit("2452345245", "xyz"); List <AspNetUser> us = (List <AspNetUser>)vr.ViewData.Model; //assert Assert.IsNotNull(vr); Assert.IsTrue(us.Exists(u => u.Id.Equals("abc"))); }