public async void GetModuleContentByModuleId_CalledWithValidId_ReturnsOkWithListOfModuleContent()
        {
            IUnitOfWork    unitOfWork    = Substitute.For <IUnitOfWork>();
            ICookieManager cookieManager = Substitute.For <ICookieManager>();

            var testId     = 1;
            var testModule = new Module {
                Id = testId
            };
            var testModuleContents = new List <ModuleContent>()
            {
                new ModuleContent {
                    Module = testModule
                }, new ModuleContent {
                    Module = testModule
                }, new ModuleContent {
                    Module = testModule
                }, new ModuleContent {
                    Module = testModule
                }
            };

            unitOfWork.ModuleContents.GetModuleContentsByModuleId(testId).Returns(testModuleContents);

            var moduleContentsController = new ModuleContentsController(unitOfWork, cookieManager);

            var result = await moduleContentsController.GetModuleContentByModuleId(testId);

            var okObjectResult = Assert.IsType <OkObjectResult>(result);
            var retrunValue    = Assert.IsType <List <ModuleContent> >(okObjectResult.Value);

            Assert.Equal(testModuleContents.Count, retrunValue.Count);
            Assert.Equal(testId, retrunValue[0].Module.Id);
        }
        public async void GetModuleContentByModuleId_CalledWithInvalidId_ReturnsNotFoundWithId()
        {
            IUnitOfWork    unitOfWork    = Substitute.For <IUnitOfWork>();
            ICookieManager cookieManager = Substitute.For <ICookieManager>();

            var testId = 1235;
            List <ModuleContent> nullModuleContents = null;

            unitOfWork.ModuleContents.GetModuleContentsByModuleId(testId).Returns(nullModuleContents);

            var moduleContentsController = new ModuleContentsController(unitOfWork, cookieManager);

            var result = await moduleContentsController.GetModuleContentByModuleId(testId);

            var notFoundObjectResult = Assert.IsType <NotFoundObjectResult>(result);
            var returnValue          = Assert.IsType <long>(notFoundObjectResult.Value);

            Assert.Equal(testId, returnValue);
        }