public void OnDeleteAtPosition_NullArray_IsInvalid()
        {
            //Arrange
            int[] testarraylist = null;

            //Act
            var result = arrayOperations.DeleteAtPosition(1, testarraylist);

            //Assert
            Assert.IsNull(result);
        }
Example #2
0
        public HttpResponseMessage DeletePart(int position, [FromUri] int[] productIds)
        {
            if (productIds == null)
            {
                return new HttpResponseMessage()
                       {
                           Content = new StringContent("", Encoding.UTF8, "text/html")
                       }
            }
            ;

            var output = arrayOperations.DeleteAtPosition(position, productIds);

            return(new HttpResponseMessage()
            {
                Content = new StringContent(string.Format("[{0}]", string.Join(", ", output)), Encoding.UTF8, "text/html")
            });
        }
    }