public void GetForUnitDO_Error() { var mockFacade = new Mock <IGarmentDOItemFacade>(); mockFacade.Setup(x => x.ReadForUnitDO(It.IsAny <string>(), It.IsAny <string>())) .Throws(new Exception()); GarmentDOItemController controller = GetController(mockFacade); var response = controller.GetForUnitDO(); Assert.Equal((int)HttpStatusCode.InternalServerError, GetStatusCode(response)); }
public void GetForUnitDO_Success() { var mockFacade = new Mock <IGarmentDOItemFacade>(); mockFacade.Setup(x => x.ReadForUnitDO(It.IsAny <string>(), It.IsAny <string>())) .Returns(new List <object>()); GarmentDOItemController controller = GetController(mockFacade); var response = controller.GetForUnitDO(); Assert.Equal((int)HttpStatusCode.OK, GetStatusCode(response)); }