swift Xcode unit test: Cannot convert value of type “Person” to expected argument type “Person”

后端 未结 1 338
故里飘歌
故里飘歌 2021-01-19 04:17

I am trying to write a unit test class to test my custom classes. When I am trying to call a method in the custom class with a custom object as the input variable, I got: \'

1条回答
  •  执念已碎
    2021-01-19 04:47

    I was running into this issue earlier. It turns out that the system under test (in my case it was a service calling the object; a PersonService for your example, perhaps) did not have Target membership to the test project. I just clicked the .swift file, and made sure both the main project and test project were checked.

    Hope this helps!

    0 讨论(0)
提交回复
热议问题