public void Should_Success_Get_by_Code() { var validateMock = new Mock <IValidateService>(); validateMock.Setup(s => s.Validate(It.IsAny <InventoryViewModel>())).Verifiable(); var mockFacade = new Mock <InventoryFacade>(); mockFacade.Setup(x => x.getDatabyCode(It.IsAny <string>(), It.IsAny <int>())) .Returns(new List <Inventory> { Model }); var mockMapper = new Mock <IMapper>(); mockMapper.Setup(x => x.Map <List <InventoryViewModel> >(It.IsAny <List <Inventory> >())) .Returns(new List <InventoryViewModel> { ViewModel }); InventoriesController controller = GetController(mockFacade, validateMock, mockMapper); var response = controller.GetName(It.IsAny <string>(), It.IsAny <int>()); Assert.Equal((int)HttpStatusCode.OK, GetStatusCode(response)); }