I have the following classes in the test target:
class AbstractBaseClass: XCTestCase {
var sut: SystemInterface!
func test1(){}
func test2(){}
func test3(){}
}
And then I have 2 more subclasses:
final class TestSystem1: AbstractBaseClass {
func setUp() {
sut = System1()
}
}
final class TestSystem2: AbstractBaseClass {
func setUp() {
sut = System2()
}
}
I’d like to share the same test suite for both system1 and system2. However, I’d like the AbstractBaseClass
test suite not to be executed.
Instead, everything works fine, except that I’m obviously getting an error as the AbstractBaseClass
tests are executed without any system in it, as the sut
is nil
.
Is there any way to resolve this problem?