ios - Shared tests in XCTest test suites -


I have a class that can be configured to do 2 different things I want to test both ways Class is the descendant of UIViewController and most configurations are in the interface builder. I have to verify that both storyboard views and their outlets are connected in the same way, but also to check for difference in behavior.

I want to use the shared XCTest suite for this purpose.

The purpose of one is to experiment with the left hand, while using an app for the right, both appear after one. The first one (right hand) triggers a segue for each other, the last one (left hand) should trigger a different segue. This is where it is different, for example.

Now I want to verify seguoys with trials. I would like to create a BothHandSharedTests suite, which are used to verify everything used to see both the admin instance tests, however, BothHandSharedTests -Used test suite is considered as, which is clearly not.

I have come up with these strategies:

  • Heir to an Exist Expectation descendant, as described above (it does not seem like),
  • < Li> Write test AUT for common properties and use one of two in the form of object under test, and add two small suites to the differences.

How do you solve this problem?

I do not have a critical answer, but that is what I am doing.

I tried the first sub-closing path in the parental test ("abstractestascias") I had implemented all the tests performed by the abortesthesis subclasses, but added the macro so that they could not escape from the actual parental testing.

  #define DONT_RUN_TEST_IF_PARENT if ([[self-classname] is exceltoosting: @ "sartast seas"]) {return; }  

Then I added this macro at the beginning of each exam, such as:

  - (zero) exam some {DONT_RUN_TEST_IF_PARENT ... actual test code ...}  

In this way, all the trials that will be received in the concertstasy sez classes, which are obtained from the abstracottesciences, will be shared and will be automatically run.

However - This has proven to be a crappy solution for some reasons:

P>

  1. This confuses Xcodes test UI It's not what you are actually running, it does not get to see a live presentation, and sometimes the exams are not intended. It tests click failures to debug difficult or impossible.
  2. It confuses XCTest itself - I came to know that the tests will continue even when I did not even ask them (if I was just trying to run a single test) and so did the test What production I would not expect.
  3. Honestly this is a macro macros which redirects flow control, in fact, never considered a good idea. Instead, I am now using a shared object, a TestCaseHelper , which is immediate for each test class, and has a protocol / representative pattern, all test cases, it is less dry - Most test cases are duplicates of others - but at least they are simple. In this way, Xcode does not get confused, and debugging failure is still possible.

    There is a better solution than Apple, unless you are interested in doing anything else for your entire test suite.


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -