0
테이블 뷰 셀의 값이 올바른지 테스트하려고합니다. 셀은 사용자 정의되고 자체 xib 파일이 있습니다. 내가 myApplicationTests
에 XIB 파일에 모듈을 변경하면이 테스트 케이스에 대한 제대로 작동하기 시작하지만 일반적인 응용 프로그램 실행 작동하지 않습니다 Could not cast value of type 'myApplication.OrganizationTableViewCell' to 'myApplicationTests.OrganizationTableViewCell'
UITableView 셀의 단위 테스트. 셀의 펜촉에 대한 액세스
:이 코드
self.organizationController?.organizationsTableView.registerNib(UINib.init(nibName:String(OrganizationTableViewCell), bundle: nil), forCellReuseIdentifier: String(OrganizationTableViewCell))
let organizationName = "Name"
let organization = Organization.organizationWithName(organizationName, index: 0)
self.organizationController?.organizations = [organization]
let cell = self.organizationController?.organizationsTableView.cellForRowAtIndexPath(NSIndexPath(forRow: 0, inSection: 0)) as! OrganizationTableViewCell
XCTAssertEqual(cell.organizationNameLabel.text, organizationName, "Cell created properly")
나는 오류를 얻었다. 이 문제를 어떻게 해결할 수 있습니까?