コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }