Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test cases for dictionary link generation #7706

Merged
merged 4 commits into from Mar 28, 2017

Conversation

yeexinc
Copy link
Contributor

@yeexinc yeexinc commented Mar 14, 2017

Purpose

This PR adds test cases for functions used while generating the dictionary links on context menu help popups (#7572 and #7661).
Tests are done on the functions GetAllFunctionDescriptors() and ConstructDictionaryLinkFromLibrary().

Declarations

Check these if you believe they are true

  • The code base is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning, and are documented in the API Changes document.

Reviewers

@aparajit-pratap

FYIs


[Test]
[Category("UnitTests")]
public void GetAllFunctionDescriptorsTest()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yeexinc the nodes can change over time so this test may not hold true when a new overload is added for any of these nodes for example. We usually test the library services against a dummy library in the test framework called FFITarget.dll. See other tests using this library.

@yeexinc
Copy link
Contributor Author

yeexinc commented Mar 27, 2017

Thanks for the review @aparajit-pratap , I've updated the test case for it. Please take a look.

descriptors = libraryServices.GetAllFunctionDescriptors("Invalid node name");
Assert.IsNull(descriptors);
// Get the function groups that are named FFITarget.TestOverloadConstructor.TestOverloadConstructor
var descriptors = libraryServices.GetFunctionGroups(libraryPath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we are testing for both GetFunctionGroups as well as GetAllFunctionDescriptors in this unit test. Can't we simply test for the result from GetAllFunctionDescriptors against the constant number? That number should not change since they belong to FFITarget and even if they do, the test can be updated accordingly.

@yeexinc
Copy link
Contributor Author

yeexinc commented Mar 27, 2017

@aparajit-pratap - The test case has been updated accordingly. Thanks!

@aparajit-pratap
Copy link
Contributor

Thanks @yeexinc

@@ -31,6 +33,7 @@ public override void Setup()
libraryCore.ParsingMode = ParseMode.AllowNonAssignment;

var pathResolver = new TestPathResolver();
pathResolver.AddPreloadLibraryPath("ProtoGeometry.dll");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yeexinc please remove this line

@aparajit-pratap aparajit-pratap merged commit 96c0122 into DynamoDS:master Mar 28, 2017
@yeexinc yeexinc deleted the b-dictionarytest branch April 26, 2017 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants