Used XCTAssert instead of XCTAssertTrue
Refactored and added tests