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

Switch tests from using reflection to get values to using internal access. #288

Closed
karljj1 opened this issue May 23, 2022 · 2 comments
Closed
Assignees
Labels

Comments

@karljj1
Copy link
Collaborator

karljj1 commented May 23, 2022

Hey.
I'm currently going through the 3.0 features and merging what I can into our version(we use an older version of .net), so I'm reading through all the code at the moment, kind of a mini code review ;)
I noticed that in some tests(ReflectionFormatterTests) you are using reflection to get at internal values to test them. I have found it simpler and safer to use internal access for this use case. E.G Remove GetInstanceField and make the type cache property internal. Then use assembly: InternalsVisibleTo to give your tests internal access.

@axunonb axunonb self-assigned this May 24, 2022
@axunonb axunonb added the Task label May 24, 2022
@axunonb
Copy link
Member

axunonb commented May 24, 2022

Gosh, I remember, This has not found its way from the brain to the to-do list 😉
There should also be a test case for SmartSettings.IsThreadSafeMode enabled / disabled.
Gonna fix that.

@axunonb
Copy link
Member

axunonb commented May 29, 2022

Closed with PR #291

@axunonb axunonb closed this as completed May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants