コード例 #1
0
        public void SearchModeKeywordBasicVisibilityTest()
        {
            var categories = new categories();

            var searchViewModel = Mediator.Index(null, ApprenticeshipSearchMode.Keyword, false).ViewModel;
            var view            = categories.RenderAsHtml(searchViewModel);

            view.GetElementbyId("categories").Attributes["class"].Value.Contains(" active").Should().BeFalse();
        }
コード例 #2
0
        public void SearchModeCategoryBasicVisibilityTest()
        {
            var categories = new categories();

            var searchViewModel = Mediator.Index(ApprenticeshipSearchMode.Category).ViewModel;
            var view            = categories.RenderAsHtml(searchViewModel);

            view.GetElementbyId("categories").Attributes["class"].Value.Contains(" active").Should().BeTrue();
            view.GetElementbyId("category-load-failed").Should().BeNull();
        }
コード例 #3
0
        public void CategorySelected()
        {
            var categories = new categories();

            var searchViewModel = Mediator.Index(null, ApprenticeshipSearchMode.Category, false).ViewModel;

            searchViewModel.Category = "3";
            var view = categories.RenderAsHtml(searchViewModel);

            view.GetElementbyId("category-" + searchViewModel.Category.ToLower()).Should().NotBeNull();
        }
コード例 #4
0
        public void SearchModeCategoryNullCategoriesVisibilityTest()
        {
            ReferenceDataService.Setup(rds => rds.GetCategories());

            var categories = new categories();

            var searchViewModel = Mediator.Index(null, ApprenticeshipSearchMode.Category, false).ViewModel;
            var view            = categories.RenderAsHtml(searchViewModel);

            view.GetElementbyId("category-load-failed").Should().NotBeNull();
        }
コード例 #5
0
        public void CategoryListPopulation()
        {
            var categories = new categories();

            var searchViewModel = Mediator.Index(null, ApprenticeshipSearchMode.Category, false).ViewModel;
            var view            = categories.RenderAsHtml(searchViewModel);

            var categoryListLeft = view.GetElementbyId("category-list-left");

            categoryListLeft.Should().NotBeNull();
            categoryListLeft.ChildNodes.Count(n => n.Name == "li").Should().Be(2);
            var categoryListRight = view.GetElementbyId("category-list-right");

            categoryListRight.Should().NotBeNull();
            categoryListRight.ChildNodes.Count(n => n.Name == "li").Should().Be(1);
        }