ridvankucuk
ridvankucuk

Reputation: 2407

Unit test Coverage percentage %0

I have written a simple application with a class that returns a boolean value. Here is my class:

class Functions {


    func someMethod() -> Bool{

        return true

    }

}

And i have written a simple Unit test class to test Functions class. Such as:

import XCTest
@testable import simpleApplication

class FunctionsTests: XCTestCase {

    func testSomeMethod(){

        let operation = Functions()


        XCTAssertTrue(operation.someMethod())

    }

}

The unit test passes. However the coverage is %0. You can see the coverage image here. Any idea?

Upvotes: 2

Views: 990

Answers (1)

ridvankucuk
ridvankucuk

Reputation: 2407

Removing the test target from my class (Functions in my case) resolved my problem. If you don't include the tests in the target membership of your class, everything should work.

Upvotes: 3

Related Questions