public void GetAllStages_Returns_tasks()
        {
            IEnumerable <Stage> objstageList = new List <Stage> {
                new Stage {
                    StageId = 1,
                }, new Stage {
                    StageId = 2
                }
            };
            //Arrange
            int bookId = 1;
            int envId  = 1;

            stageServiceMoq.Setup(c => c.GetAllStages(bookId, envId)).Returns(objstageList);

            //Act
            var controller = new StageController(logger.Object, stageServiceMoq.Object);
            var result     = controller.GetAllStages(bookId, envId);

            // assert
            Assert.IsType <OkObjectResult>(result.Result);
            var okResult = result.Result as OkObjectResult;

            Assert.NotNull(okResult);
            Assert.Equal(200, okResult.StatusCode);
            Assert.Equal(objstageList, okResult.Value);
            stageServiceMoq.Verify(c => c.GetAllStages(bookId, envId), Times.Once());
        }
        public void GetAllTask_Invalid_StageIdId()
        {
            //Arrange
            int bookId = 0;
            int envId  = 0;

            //Act
            var controller = new StageController(logger.Object, stageServiceMoq.Object);
            var result     = controller.GetAllStages(bookId, envId);
            var BadRequest = result.Result as BadRequestObjectResult;

            // assert
            Assert.NotNull(BadRequest);
            Assert.Equal(400, BadRequest.StatusCode);
            Assert.Equal($"Invalid Book Id : {bookId} or Environment Id : {envId}", BadRequest.Value);
        }