public void Archive_Flow_RedirectToRouteResult() { // Arrange var mainUser = new User { Id = 1, FirstName = "Unit", LastName = "Test", UserName = "******", Mail = "*****@*****.**" }; var users = new List <User>() { mainUser }.AsQueryable(); var mainGroup = new Group { Id = 1, }; var groups = new List <Group>() { mainGroup }.AsQueryable(); var mockContext = new Mock <Context>(); var mockGroups = MockHelper.MockDbSet(groups); mockContext.SetupGet(c => c.Groups).Returns(mockGroups.Object); var mockUserHelper = new Mock <IUserHelper>(); mockUserHelper.Setup(x => x.GetCurrentUser().Id).Returns(mainUser.Id); var controller = new GroupController(mockContext.Object, mockUserHelper.Object); // Act RedirectToRouteResult resultGroupNotNull = controller.Archive(mainGroup.Id) as RedirectToRouteResult; RedirectToRouteResult resultGroupNull = controller.Archive(0) as RedirectToRouteResult; // Assert Assert.IsNotNull(resultGroupNotNull); Assert.IsNotNull(resultGroupNull); }