public async Task <ActionResult <int[]> > DeletePartialElement( int position, [FromQuery(Name = "productIds")] int[] productIds) { var result = await _arrayCalculationService.DeletePartialElement(position, productIds); return(Ok(result)); }
public async Task WhenArrayCalculationServiceDeletePartialElementReturnsValueThenResultIsOk() { var array = new [] { 1 }; _arrayCalculationService .DeletePartialElement(Arg.Any <int>(), Arg.Any <int[]>()) .Returns(array); var result = await _arrayCalculationController.DeletePartialElement(0, null); result.Result.Should().BeOfType <OkObjectResult>(); }
public async Task WhenInputArrayIsNullThenDeletePartialElementThrowsInvalidOperationException() { await Assert.ThrowsAsync <ArgumentNullException>( async() => await _arrayCalculationService.DeletePartialElement(0, null)); }