ENH: Simplify TestAddRefrencedNodeIDWithNoScene

This commit extends "CheckNthNodeReferenceID()" function by introducing
the extra parameter named "referencingNodeAddedToScene" and refactor the
test to use it.

Issue #3708

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23308 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Simplify TestAddDelayedReferenceNode

This commit refactors the function "CheckNthNodeReferenceID"
to take an extra parameter named "expectedNodeReferenceID". This allows
the function to test the reference ID independently of the node reference
instance.

It also update the test to use convenience function where possible.

Issue #3708

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23309 3bd1e089-480b-0410-8dfb-8563597acbee