Is use of generics valid in XCTestCase subclasses? : <p>I have a <code>XCTestCase</code> subclass that looks something like this. I have removed <code>setup()</code> and <code>tearDown</code> methods for brevity: </p>

<pre><code>class ViewControllerTests &lt;T : UIViewController&gt;: XCTestCase {
    var viewController : T!

    final func loadControllerWithNibName(string:String) {
        viewController  = T(nibName: string, bundle: NSBundle(forClass: ViewControllerTests.self)) 
        if #available(iOS 9.0, *) {
            viewController.loadViewIfNeeded()
        } else {
            viewController.view.alpha = 1
        }
    }
}
</code></pre>

<p>And its subclass that looks something like this : </p>

<pre><code>class WelcomeViewControllerTests : ViewControllerTests&lt;WelcomeViewController&gt; {
    override func setUp() {
        super.setUp()
        self.loadControllerWithNibName("welcomeViewController")
        // Put setup code here. This method is called before the invocation of each test method in the class.
    }

    func testName() {
       let value =  self.viewController.firstNameTextField.text
        if value == "" {
            XCTFail()
        }
    }
}
</code></pre>

<p>In theory, this should work as expected -- the compiler doesn't complain about anything. But it's just that when I run the test cases, the <code>setup()</code> method doesn't even get called. But, it says the tests have passed when clearly <code>testName()</code> method should fail. </p>

<p>Is the use of generics a problem? I can easily think of many non-generic approaches, but I would very much want to write my test cases like this. Is the XCTest's interoperability between Objective-C and Swift the issue here? </p>
