public async void GetAssigmentsByModule_CalledWithValidModuleName_ReturnOkWithAssigmentsCollection()
        {
            IUnitOfWork    _unitOfWork    = Substitute.For <IUnitOfWork>();
            ICookieManager _cookieManager = Substitute.For <ICookieManager>();

            var oopModule = new Module()
            {
                Title = "Oop"
            };
            var oopAssigmentList = new List <Assigment>()
            {
                new Assigment()
                {
                    Module = oopModule
                }, new Assigment()
                {
                    Module = oopModule
                }
            };
            string moduleName = "Oop";

            _unitOfWork.Assigments.GetAssigmentsByModuleName(moduleName).Returns(oopAssigmentList);

            var assigmentsController = new AssigmentsController(_unitOfWork, _cookieManager);

            var result = await assigmentsController.GetAssigmentsByModule(moduleName);

            var okObjectResult = Assert.IsType <OkObjectResult>(result);
            var returnValue    = Assert.IsType <List <Assigment> >(okObjectResult.Value);

            Assert.Equal(oopAssigmentList.Count, returnValue.Count);
            Assert.Equal(moduleName, returnValue[0].Module.Title);
        }
        public async void GetAssigmentsByModule_CalledWithNull_ReturnsBadRequestWithError()
        {
            IUnitOfWork    _unitOfWork    = Substitute.For <IUnitOfWork>();
            ICookieManager _cookieManager = Substitute.For <ICookieManager>();

            string nullModuleName = null;
            string error          = "Module name cannot be null.";

            var assigmentsController = new AssigmentsController(_unitOfWork, _cookieManager);

            var result = await assigmentsController.GetAssigmentsByModule(nullModuleName);

            var badRequestobjectResult = Assert.IsType <BadRequestObjectResult>(result);
            var returnValue            = Assert.IsType <string>(badRequestobjectResult.Value);

            Assert.Equal(error, returnValue);
        }