Skip to content

Commit

Permalink
Update SystemTestBase.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
pinzart90 authored Jan 8, 2024
1 parent 9b0477a commit ca27bbd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/Libraries/SystemTestServices/SystemTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public void AssertPreviewCount(string guid, int count)
}

/// <summary>
/// Returns the NodeModel corresponding to the input guid as type T
/// Returns the NodeModel corresponding to the input guid
/// </summary>
/// <typeparam name="T">A NodeModel (or derived) type</typeparam>
/// <param name="guid">The node Guid</param>
Expand All @@ -316,7 +316,9 @@ public void AssertPreviewCount(string guid, int count)
[Obsolete("This method will be removed in a future version of Dynamo")]
public NodeModel GetNode<T>(string guid) where T : class
{
if (typeof(T) == typeof(NodeModel) || typeof(T).IsSubclassOf(typeof(NodeModel)))
bool isNodeModel = typeof(T) == typeof(NodeModel);
bool isDerivedFromNodeModel = typeof(T).IsSubclassOf(typeof(NodeModel));
if ( !isNodeModel && !isDerivedFromNodeModel)
{
throw new Exception($"{typeof(T)} is not of type NodeModel");
}
Expand Down

0 comments on commit ca27bbd

Please sign in to comment.