Skip to content

add UtilsTests for Reflections and Math#58

Open
bacchuongdaungo wants to merge 21 commits into
release-v2.0from
test/utils-2
Open

add UtilsTests for Reflections and Math#58
bacchuongdaungo wants to merge 21 commits into
release-v2.0from
test/utils-2

Conversation

@bacchuongdaungo
Copy link
Copy Markdown

fix wrong-place utils test

Copy link
Copy Markdown
Owner

@lhmcgann lhmcgann left a comment

Choose a reason for hiding this comment

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

Great start! Check code coverage. And if you could edit the formatting a bit (I started it) and add doc-comments (for test methods and methods tested) and in-line comments for anything more complicated, that would be great

…thods tested and in-line comments for anything more complicated
Copy link
Copy Markdown
Owner

@lhmcgann lhmcgann left a comment

Choose a reason for hiding this comment

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

The existing tests are good, but a few main things:

  1. check code coverage! There are still some fully untested functions, and many functions with only partial coverage. See the report for line-by-line coverage highlighting.
  2. The doc comments in the test class are great! Just please add doc comments to all the Utils.cs source reflection functions as well!
  3. You can delete the GetAvailableStimulatorTypes() utils function in Utils.cs, as well as the associated TODO comment, and don't worry about testing that or letting it mess up your coverage report

Comment thread docs/images/association_arrows-techvidvan.png
Comment thread tests/EStimLibrary.UnitTests/Core/UtilsTests.cs Outdated
Comment thread tests/EStimLibrary.UnitTests/Core/UtilsTests.cs Outdated
bacchuongdaungo and others added 3 commits February 6, 2025 04:24
… doc comments for them, refactored temp interfaces to avoid confusion, uniformed test name style
… doc comments for them, refactored temp interfaces to avoid confusion, uniformed test name style
@lhmcgann lhmcgann changed the title add UtilsTests for Reflections add UtilsTests for Reflections and Math Feb 10, 2025
Copy link
Copy Markdown
Owner

@lhmcgann lhmcgann left a comment

Choose a reason for hiding this comment

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

@bacchuongdaungo Glad the CI/CD fix was easy, and nice using the IFactory we already have. Check code coverage report for the following Reflection functions:

  1. IsAssignableFromType()
  2. IsGenericAssignableFrom()
  3. GetAvailableGenericTypes()
  4. IsManufacturableProduct()

And make sure there are doc comments /// for all the reflection and math functions
(I'm including the first few functions in the Math region in this PR since you already included tests for them)

- IsAssignableFrom test cases; some FAILing
- comments and other cleanup
- Fixed generic assignability by scanning base classes and interfaces,
  and by checking type parameters.
- Updated dummy type hierarchies and test expectations in UtilsTests.cs.
- All tests now pass.
…eEnumerableOfStrings, DictOfSetsToString, SelectFromList, ConstructWithUserInputParams, etc.)

- Refined reflection and assignability tests
- Minor cleanup and documentation updates
  • IsGenericAssignableFrom for non-generic test types
  • AreTypeParametersCompatible with covariant and incompatible types
  • ReadJSON error path when file is missing
  • EnumerableToString with empty enumerable
  • SelectFromList with invalid then valid input
  • SelectPort (if available)
  • RequestConstructorParameterValues using a multi-parameter dummy constructor
…ignableFrom`, and `RequestFactoryCreateParamValues`.

- Improved existing tests by removing dummy implementations and leveraging actual IDataLimits implementations.
- Fixed TypeConverter issues during testing sequences and collection parsing.
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.

2 participants