public void DeleteItemFromArrayItems_ShouldDeleteRequestedItemAndReturnRemainingItems(string requestParams, int[] expectedResult) { // Arrange _controller.Request = new HttpRequestMessage(HttpMethod.Delete, "http://localhost:57313/api/arraycalc/deletepart?" + requestParams); _arrayManipulationRepository.DeleteItemFromArray(Arg.Any <IEnumerable <KeyValuePair <string, string> > >()) .Returns(expectedResult); // Act var actualResult = _controller.DeleteItemFromArrayItems(); // Assert Assert.AreEqual(expectedResult, actualResult); }
public int[] DeleteItemFromArrayItems() { return(Request != null?_arrayManipulationRepository.DeleteItemFromArray(Request.GetQueryNameValuePairs()) : null); }