Browse() private method

private Browse ( ) : System.Web.Mvc.ActionResult
return System.Web.Mvc.ActionResult
            public void Returns_RoleSearchResults()
            {
                var queryProcessor = new Mock <IProcessQueries>(MockBehavior.Strict);

                queryProcessor.Setup(m => m.Execute(It.IsAny <FindAllRolesQuery>()))
                .Returns(new[]
                {
                    new Role {
                        Name = "role 1"
                    },
                    new Role {
                        Name = "role 2"
                    },
                });
                var controller = new RolesController(CreateRolesServices(queryProcessor.Object));

                var result = controller.Browse();

                result.ShouldNotBeNull();
                result.ShouldBeType <ViewResult>();
                var viewResult = (ViewResult)result;

                viewResult.Model.ShouldNotBeNull();
                viewResult.Model.ShouldImplement <IEnumerable <RoleSearchResult> >();
                var strongModel = ((IEnumerable <RoleSearchResult>)viewResult.Model).ToArray();

                strongModel.Length.ShouldEqual(2);
            }
            public void Invokes_Query()
            {
                var queryProcessor = new Mock<IProcessQueries>(MockBehavior.Strict);
                queryProcessor.Setup(m => m.Execute(It.IsAny<FindAllRolesQuery>()))
                    .Returns(new[]
                    {
                        new Role { Name = "role 1" },
                        new Role { Name = "role 2" },
                    });
                var controller = new RolesController(CreateRolesServices(queryProcessor.Object));

                var result = controller.Browse();

                result.ShouldNotBeNull();
                queryProcessor.Verify(r => r.Execute(It.IsAny<FindAllRolesQuery>()), Times.Once());
            }
            public void Returns_RoleSearchResults()
            {
                var queryProcessor = new Mock<IProcessQueries>(MockBehavior.Strict);
                queryProcessor.Setup(m => m.Execute(It.IsAny<FindAllRolesQuery>()))
                    .Returns(new[]
                    {
                        new Role { Name = "role 1" },
                        new Role { Name = "role 2" },
                    });
                var controller = new RolesController(CreateRolesServices(queryProcessor.Object));

                var result = controller.Browse();

                result.ShouldNotBeNull();
                result.ShouldBeType<ViewResult>();
                var viewResult = (ViewResult)result;
                viewResult.Model.ShouldNotBeNull();
                viewResult.Model.ShouldImplement<IEnumerable<RoleSearchResult>>();
                var strongModel = ((IEnumerable<RoleSearchResult>)viewResult.Model).ToArray();
                strongModel.Length.ShouldEqual(2);
            }
            public void Invokes_Query()
            {
                var queryProcessor = new Mock <IProcessQueries>(MockBehavior.Strict);

                queryProcessor.Setup(m => m.Execute(It.IsAny <FindAllRolesQuery>()))
                .Returns(new[]
                {
                    new Role {
                        Name = "role 1"
                    },
                    new Role {
                        Name = "role 2"
                    },
                });
                var controller = new RolesController(CreateRolesServices(queryProcessor.Object));

                var result = controller.Browse();

                result.ShouldNotBeNull();
                queryProcessor.Verify(r => r.Execute(It.IsAny <FindAllRolesQuery>()), Times.Once());
            }