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