Write a function as described below and test scenarios to test its validity.
Write a function that finds missing number in array:
Given array of sequent numbers 0,1,2,3...N with missing member
Function finds a first missing number occurrence in the sequence.
Input: [5,0,1,3,2]
Output: 4
Input: [7,9,10,11,12]
Output: 8
Implement the function + tests and explain your thinking and assumptions as comments.