public void Should_Success_Get_Report()
        {
            var mockFacade = new Mock <IGarmentBC23ReportFacade>();

            mockFacade.Setup(x => x.GetReport(It.IsAny <DateTime>(), It.IsAny <DateTime>(), It.IsAny <int>(), It.IsAny <int>(), It.IsAny <string>(), It.IsAny <int>()))
            .Returns(Tuple.Create(new List <GarmentBC23ReportViewModel> {
                viewModel
            }, 25));

            var mockMapper = new Mock <IMapper>();

            mockMapper.Setup(x => x.Map <List <GarmentBC23ReportViewModel> >(It.IsAny <List <GarmentBC23ReportViewModel> >()))
            .Returns(new List <GarmentBC23ReportViewModel> {
                viewModel
            });

            var user   = new Mock <ClaimsPrincipal>();
            var claims = new Claim[]
            {
                new Claim("username", "unittestusername")
            };

            user.Setup(u => u.Claims).Returns(claims);
            GarmentBC23ReportController controller = new GarmentBC23ReportController(mockFacade.Object, GetMockServiceProvider().Object);

            controller.ControllerContext = new ControllerContext()
            {
                HttpContext = new DefaultHttpContext()
                {
                    User = user.Object
                }
            };

            controller.ControllerContext.HttpContext.Request.Headers["Authorization"] = "Bearer unittesttoken";
            controller.ControllerContext.HttpContext.Request.Path = new PathString("/v1/unit-test");
            controller.ControllerContext.HttpContext.Request.Headers["x-timezone-offset"] = "7";

            var response = controller.GetReport(It.IsAny <DateTime>(), It.IsAny <DateTime>(), It.IsAny <int>(), It.IsAny <int>(), It.IsAny <string>());

            Assert.Equal((int)HttpStatusCode.OK, GetStatusCode(response));
        }
        public void Should_Error_Get_Report_Data()
        {
            var mockFacade = new Mock <IGarmentBC23ReportFacade>();

            mockFacade.Setup(x => x.GetReport(It.IsAny <DateTime>(), It.IsAny <DateTime>(), It.IsAny <int>(), It.IsAny <int>(), It.IsAny <string>(), It.IsAny <int>()))
            .Returns(Tuple.Create(new List <GarmentBC23ReportViewModel> {
                viewModel
            }, 25));

            var mockMapper = new Mock <IMapper>();

            mockMapper.Setup(x => x.Map <List <GarmentBC23ReportViewModel> >(It.IsAny <List <GarmentBC23ReportViewModel> >()))
            .Returns(new List <GarmentBC23ReportViewModel> {
                viewModel
            });

            var user   = new Mock <ClaimsPrincipal>();
            var claims = new Claim[]
            {
                new Claim("username", "unittestusername")
            };

            user.Setup(u => u.Claims).Returns(claims);
            GarmentBC23ReportController controller = new GarmentBC23ReportController(mockFacade.Object, GetMockServiceProvider().Object);

            controller.ControllerContext = new ControllerContext()
            {
                HttpContext = new DefaultHttpContext()
                {
                    User = user.Object
                }
            };
            //controller.ControllerContext.HttpContext.Request.Headers["x-timezone-offset"] = "0";
            var response = controller.GetReport(null, null, 0, 0, null);

            Assert.Equal((int)HttpStatusCode.InternalServerError, GetStatusCode(response));
        }