public void GetByParentId_ValidId_ShouldReturnValidObject()
        {
            listItems[0].Departments = childListItems;
            mock.Setup(repo => repo.GetAllItems(null)).Returns(listItems.AsQueryable());
            mockChild.Setup(repo => repo.GetItemsByParentId(1, null)).Returns(childListItems.AsQueryable());

            var controller = new OfferingController(mockChild.Object, mock.Object);
            var result     = controller.GetDepartmentsByIdOffering(1);

            Assert.IsAssignableFrom <ActionResult <IEnumerable <Department> > >(result);
            Assert.Equal(listItems[0].Departments.Count, result.Value.ToList().Count);
        }
        public void GetByParentId_InvalidId_ShouldReturnNotFoundResult()
        {
            listItems[0].Departments = childListItems;
            mock.Setup(repo => repo.GetAllItems(null)).Returns(listItems.AsQueryable());
            mockChild.Setup(repo => repo.GetItemsByParentId(4, null)).Returns(childListItems.AsQueryable());

            var controller = new OfferingController(mockChild.Object, mock.Object);
            var result     = controller.GetDepartmentsByIdOffering(4);

            Assert.IsAssignableFrom <ActionResult <IEnumerable <Department> > >(result);
            Assert.IsType <NotFoundResult>(result.Result);
        }