Refactor tests on fragments and add more.