Skip to content

Conversation

Horusiath
Copy link
Contributor

One of the not so obvious requirements for writing MultiNode TestKit test classes is that, this class must not only inherit from MultiNodeSpec, but somewhere in its inheritance chain it also must specify a constructor, which first parameter is a class inheriting from MultiNodeConfig.

Up to this point, if this requirement was not fulfilled, we simply crashed with NRE - since we tried to go down the test class inheritance chain until we reached System.Object, which BaseType is null.

This PR replaces recursive check with loop. When the loop ends and no correct config class was found, we throw a meaningful message informing user what has gone wrong. Example:

[MyNodeSpec] or one of its base classes must specify constructor, which first parameter is a subclass of MultiNodeConfig.

@Aaronontheweb Aaronontheweb added this to the 1.3.3 milestone Nov 27, 2017
@Aaronontheweb Aaronontheweb merged commit da41680 into akkadotnet:dev Nov 27, 2017
Horusiath added a commit to Horusiath/akka.net that referenced this pull request Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants