public void GetAllTrashed_ReturnsOnlyTrashedNodes()
        {
            //arrange
            var sectionNodeDbSet = new InMemoryDbSet <SectionNode>
            {
                new SectionNode {
                    Id = 1, InTrash = true
                },
                new SectionNode {
                    Id = 2, InTrash = true
                },
                new SectionNode {
                    Id = 3, InTrash = false
                },
                new SectionNode {
                    Id = 4, InTrash = false
                }
            };

            _dbContextMock.Setup(x => x.GetDbSet <SectionNode>()).Returns(sectionNodeDbSet);

            //act
            var sectionNodes = _sectionNodeService.GetAllTrashed();

            //assert
            sectionNodes.ToList().ForEach(x => x.InTrash.Should().Be.True());
        }
Example #2
0
        public ActionResult Index()
        {
            var sections = _sectionNodeService.GetAllTrashed();

            var model = new TrashModel
            {
                SidebarMenu     = GetAdminMenu(),
                UserMenu        = GetAdminUserMenu(),
                TrashedSections = _mapper.Map <IEnumerable <SectionNode>, IEnumerable <SectionNodeLightViewModel> >(sections)
            };

            return(View(model));
        }