public async Task ProcessResupplyAmounts_ShouldReturnResupplyRequest() { // Assemble _mockProductService.Setup(mock => mock.IncreaseProductAmount(It.IsAny <int>(), It.IsAny <int>())). Returns(Task.FromResult(1)); _supplyService = new SupplyService(_mockProductService.Object, _mockMapperService.Object); IEnumerable <Supply> supplies = new List <Supply> { new Supply { Barcode = 123, Amount = 5 }, new Supply { Barcode = 5345, Amount = 3 } }; // Assign var expectedRowsAffected = 2; // Act var rowsAffected = await _supplyService.ProcessResupplyAmounts(supplies); // Assert Assert.AreEqual(expectedRowsAffected, rowsAffected); _mockProductService.Verify(mock => mock.IncreaseProductAmount(It.IsAny <int>(), It.IsAny <int>()), Times.Exactly(2)); }