public void Should_Error_GetGarmentInternalNotes()
        {
            var mockMapper = new Mock <IMapper>();

            var controller = GetController(GetServiceProvider().Object, mockMapper);
            GarmentInternalNoteFilterDto filterDto = new GarmentInternalNoteFilterDto();
            var response = controller.GetGarmentInternalNotes("", filterDto);

            Assert.Equal((int)HttpStatusCode.InternalServerError, GetStatusCode(response));
        }
        public void Should_Success_GetGarmentInternalNotes()
        {
            Mock <IGarmentPurchasingExpeditionService> serviceMock = new Mock <IGarmentPurchasingExpeditionService>();
            var mockMapper  = new Mock <IMapper>();
            var mockService = GetServiceProvider();

            mockService
            .Setup(s => s.GetService(typeof(IGarmentPurchasingExpeditionService)))
            .Returns(serviceMock.Object);

            var controller = GetController(mockService.Object, mockMapper);
            GarmentInternalNoteFilterDto filterDto = new GarmentInternalNoteFilterDto();
            var response = controller.GetGarmentInternalNotes("", filterDto);

            Assert.Equal((int)HttpStatusCode.OK, GetStatusCode(response));
        }
Beispiel #3
0
 public IActionResult GetGarmentInternalNotes([FromQuery] string keyword, [FromQuery] GarmentInternalNoteFilterDto filter)
 {
     try
     {
         var result = _service.GetGarmentInternalNotes(keyword, filter);
         return(Ok(new
         {
             apiVersion = ApiVersion,
             statusCode = General.OK_STATUS_CODE,
             message = General.OK_MESSAGE,
             data = result
         }));
     }
     catch (Exception e)
     {
         return(StatusCode(General.INTERNAL_ERROR_STATUS_CODE, e.Message + " " + e.StackTrace));
     }
 }