private void Get_Ppn_PDF_By_Id_NullInvoice(string correctionType)
        {
            var Model = this.Model;

            Model.CorrectionType = correctionType;

            var ViewModel = this.ViewModel;

            ViewModel.UseVat = true;

            var mockFacade = new Mock <IGarmentReturnCorrectionNoteFacade>();

            mockFacade.Setup(x => x.ReadById(It.IsAny <int>()))
            .Returns(Model);

            var mockMapper = new Mock <IMapper>();

            mockMapper.Setup(x => x.Map <GarmentCorrectionNoteViewModel>(It.IsAny <GarmentCorrectionNote>()))
            .Returns(ViewModel);

            var garmentdeliveryOrder = new GarmentDeliveryOrder
            {
                DOCurrencyRate = 1,
                Items          = new List <GarmentDeliveryOrderItem>
                {
                    new GarmentDeliveryOrderItem
                    {
                        Details = Model.Items.Select(i => new GarmentDeliveryOrderDetail
                        {
                            Id = i.DODetailId
                        }).ToList()
                    }
                }
            };

            var mockGarmentDeliveryOrderFacade = new Mock <IGarmentDeliveryOrderFacade>();

            mockGarmentDeliveryOrderFacade.Setup(x => x.ReadById(It.IsAny <int>()))
            .Returns(garmentdeliveryOrder);

            var mockGarmentInvoiceFacade = new Mock <IGarmentInvoice>();

            mockGarmentInvoiceFacade.Setup(x => x.ReadByDOId(1))
            .Returns(new GarmentInvoice());

            GarmentReturnCorrectionNoteController controller = GetController(mockFacade, null, mockMapper, mockGarmentDeliveryOrderFacade, null, mockGarmentInvoiceFacade);

            controller.ControllerContext.HttpContext.Request.Headers["Accept"] = "application/pdf";

            var response = controller.GetReturnNotePpn(It.IsAny <int>());

            Assert.NotNull(response.GetType().GetProperty("FileStream"));
        }
        public void Should_Error_Get_Ppn_Data_By_Id()
        {
            var mockFacade = new Mock <IGarmentReturnCorrectionNoteFacade>();

            mockFacade.Setup(x => x.ReadById(It.IsAny <int>()))
            .Returns(Model);

            var mockMapper = new Mock <IMapper>();

            GarmentReturnCorrectionNoteController controller = new GarmentReturnCorrectionNoteController(GetServiceProvider().Object, mockMapper.Object, mockFacade.Object);
            var response = controller.GetReturnNotePpn(It.IsAny <int>());

            Assert.Equal((int)HttpStatusCode.InternalServerError, GetStatusCode(response));
        }
        public void Should_Error_Get_Ppn_Data_Invalid_By_Id()
        {
            var ViewModel = this.ViewModel;

            ViewModel.UseVat = false;

            var mockFacade = new Mock <IGarmentReturnCorrectionNoteFacade>();

            mockFacade.Setup(x => x.ReadById(It.IsAny <int>()))
            .Returns(Model);

            var mockMapper = new Mock <IMapper>();

            mockMapper.Setup(x => x.Map <GarmentCorrectionNoteViewModel>(It.IsAny <GarmentCorrectionNote>()))
            .Returns(ViewModel);

            GarmentReturnCorrectionNoteController controller = GetController(mockFacade, null, mockMapper);
            var response = controller.GetReturnNotePpn(It.IsAny <int>());

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