Omar.Ebrahim
Omar.Ebrahim

Reputation: 874

Xcode swift tests not discovered

I'm using Xcode 9 and I'm trying to write unit tests following the Apple iOS tutorial here.

Problem is that my unit tests aren't being discovered, only the stub in another test project in the same solution.

Test code

The test in the screenshot should fail, but it doesn't as it's not discovered.

The testExample method is shown below

enter image description here

As you can see it has the little diamond indicating it has a test, but not next to the one I've created. Is there anything I'm doing wrong?

Upvotes: 0

Views: 161

Answers (1)

Omar.Ebrahim
Omar.Ebrahim

Reputation: 874

The answer to this was to prefix the function name with test

So the function now looks like valid test function name

And the test is now discovered in the test explorer Test explorer

Upvotes: 1

Related Questions