This technique is not called "Inline unit tests", it's called contract programming.
I can't imagine writing such code without proper support from IDE like automatic folding and/or special colors.
There is also problem of asynchronous code, events etc. Something that can't be covered with such simple contracts.