Unittest

Cover 80% code.