public void IndexPOST_ShouldRedirectToIndex() { var file = new BasicHttpPostedFileBaseCSV(); A.CallTo(() => _bulkStockUpdateAdminService.BulkStockUpdate(file.InputStream)) .Returns(BulkStockUpdateResult.Success()); RedirectToRouteResult result = _bulkStockUpdateController.Index_POST(file); result.RouteValues["action"].Should().Be("Index"); }
public BulkStockUpdateResult Update(Stream file) { GetWarehouseStockFromFileResult result = _bulkWarehousedStockUpdateValidationService.ValidateFile(file); if (!result.IsSuccess) { return(BulkStockUpdateResult.Failure(result.Messages)); } var updateResult = _performWarehousedStockBulkUpdate.Update(result.DTOs); return(updateResult.IsSuccess ? BulkStockUpdateResult.Success(updateResult.Messages) : BulkStockUpdateResult.Failure(updateResult.Messages)); }
public BulkStockUpdateResult Update(Stream file) { GetProductVariantsFromFileResult result = _bulkSimpleStockUpdateValidationService.ValidateFile(file); if (!result.IsSuccess) { return(BulkStockUpdateResult.Failure(result.Messages)); } BulkUpdateResult updateResult = _performSimpleBulkUpdate.Update(result.DTOs); return(updateResult.IsSuccess ? BulkStockUpdateResult.Success(updateResult.Messages) : BulkStockUpdateResult.Failure(updateResult.Messages)); }