public void Should_Error_Get_All_Data_By_User()
        {
            var mockFacade = new Mock <IGarmentInternalPurchaseOrderFacade>();

            mockFacade.Setup(x => x.Read(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <string>(), null, It.IsAny <string>()))
            .Returns(Tuple.Create(new List <GarmentInternalPurchaseOrder>(), 0, new Dictionary <string, string>()));

            var mockMapper = new Mock <IMapper>();

            mockMapper.Setup(x => x.Map <List <GarmentInternalPurchaseOrderViewModel> >(It.IsAny <List <GarmentInternalPurchaseOrder> >()))
            .Returns(new List <GarmentInternalPurchaseOrderViewModel> {
                ViewModel
            });

            GarmentInternalPurchaseOrderController controller = new GarmentInternalPurchaseOrderController(GetServiceProvider().Object, mockMapper.Object, mockFacade.Object);
            var response = controller.GetByUser();

            Assert.Equal((int)HttpStatusCode.InternalServerError, GetStatusCode(response));
        }
        public void Should_Success_Get_All_Data_By_User_With_Filter()
        {
            var mockFacade = new Mock <IGarmentInternalPurchaseOrderFacade>();

            mockFacade.Setup(x => x.Read(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <string>(), null, It.IsAny <string>()))
            .Returns(Tuple.Create(new List <GarmentInternalPurchaseOrder>(), 0, new Dictionary <string, string>()));

            var mockMapper = new Mock <IMapper>();

            mockMapper.Setup(x => x.Map <List <GarmentInternalPurchaseOrderViewModel> >(It.IsAny <List <GarmentInternalPurchaseOrder> >()))
            .Returns(new List <GarmentInternalPurchaseOrderViewModel> {
                ViewModel
            });

            GarmentInternalPurchaseOrderController controller = GetController(mockFacade, null, mockMapper);
            var response = controller.GetByUser(filter: "{ 'IsPosted': false }");

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