[Fact] public async Task UploadPitchersTest()
        {
            var returnData = new List <BhqPitchingStats> {
                new BhqPitchingStats()
            };
            var section = new Mock <IConfigurationSection>();

            section.Setup(o => o.Value).Returns("pitchers.csv");
            var config = new Mock <IConfiguration>();

            config.Setup(o => o.GetSection("CsvFiles:PitcherFile")).Returns(section.Object);
            var uploadService = new Mock <ICsvFileUploaderService>();

            uploadService.Setup(o => o.UploadFile(It.IsAny <FormFileReader>(), "pitchers.csv")).Returns(Task.FromResult(0));
            var readService = new Mock <ICsvFileReaderService>();

            readService.Setup(o => o.ReadCsvData <BhqPitchingStats>(It.IsAny <FormFileReader>())).Returns(Task.FromResult(returnData));
            var request     = new Mock <HttpRequest>().Object;
            var httpContext = new Mock <HttpContext>();

            httpContext.SetupGet(a => a.Request).Returns(request);
            var controller = new BhqStatsController(readService.Object, uploadService.Object, config.Object);

            controller.ControllerContext = new ControllerContext()
            {
                HttpContext = httpContext.Object
            };
            await controller.UploadPitcherFile();

            readService.VerifyAll();
            uploadService.VerifyAll();
        }
        [Fact] public async Task UploadPitchersExceptionTest()
        {
            var readService = new Mock <ICsvFileReaderService>();

            readService.Setup(o => o.ReadCsvData <BhqPitchingStats>(It.IsAny <FormFileReader>())).ThrowsAsync(new Exception("Bad Request"));
            var request     = new Mock <HttpRequest>().Object;
            var httpContext = new Mock <HttpContext>();

            httpContext.SetupGet(a => a.Request).Returns(request);
            var controller = new BhqStatsController(readService.Object, null, null);

            controller.ControllerContext = new ControllerContext()
            {
                HttpContext = httpContext.Object
            };
            await Assert.ThrowsAsync <BadRequestException>(() => controller.UploadPitcherFile());

            readService.VerifyAll();
        }