public void TryGetImageByInvalidSettings() { Action <int> assertAction = bookId => { var message = Controller.GetBookImage(bookId); Assert.ThrowsException <AssertFailedException>(message.GetByteArrayContent); }; assertAction(-1); assertAction(2); }