2017-06-22 46 views
0

我有EntertainmentController和`EntertainmentControllerTestClass。在測試類內部,我添加了測試方法,參考了控制器中的每個方法,它們都是空方法,因此它們在運行測試時都會通過。但是當我上傳到打包應用程序時,我收到了以下消息:Apex Lightning上傳失敗,因爲缺少測試類

Upload Failed: 
No test methods found in the Apex code included in the package. At least 75% test coverage is required. 

回答

1

Apex測試必須實際測試您的業務類別。進行空測試沒有任何用處。您必須編寫單元測試來驗證您的EntertainmentController類中的代碼。單元測試必須在測試執行期間導致EntertainmentController中75%的代碼被執行而沒有失敗。 另外,當您將Apex類添加到包中時,您必須添加您的EntertainmentController和EntertainmentControllerTestClass。

Testing Apex

相關問題