/**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     /**
      * validation rules, number must be:
      * an integer
      * >= 1
      * <= 100
      */
     $this->validate($request, ['number' => 'required|integer|min:1|max:100']);
     $number = $request->get("number");
     $rangeArray = Helpers::createArrayRange($number);
     $missingNumber = Helpers::findMissingNumber($rangeArray);
     return view("test.create", compact("missingNumber", "rangeArray", $missingNumber, $rangeArray));
 }
 public function testIntegration()
 {
     $valid = 0;
     for ($i = 1; $i <= 100; $i++) {
         $rangeArray = Helpers::createArrayRange($i);
         $missingNumber = Helpers::findMissingNumber($rangeArray);
         if ($i === $missingNumber) {
             $valid++;
             continue;
         }
         $valid--;
     }
     $this->assertTrue($valid === 100);
 }