I have a C# class with various static public properties which work as keys.
Through time, this class is refactored many times and some keys are deprecated and no longer are referenced from other classes from projects in the same Visual Studio solution.
I want with reflection or some other way to check if any of these keys (properties) are used in other classes in the Visual Studio solution.
I want to write a unit test to discover if any keys are not used any more.
How I could do such thing?
Learn how to check a character value in C We have access to several useful checks: isalnum() checks if a character is alphanumeric. isalpha() checks if a character is alphabetic. iscntrl() checks if a character is a control character. isdigit() checks if a character is a digit.
The C library function int isdigit(int c) checks if the passed character is a decimal digit character. Decimal digits are (numbers) − 0 1 2 3 4 5 6 7 8 9.
The function isdigit() is used to check that character is a numeric character or not. This function is declared in “ctype. h” header file. It returns an integer value, if the argument is a digit otherwise, it returns zero.
C isalpha() In C programming, isalpha() function checks whether a character is an alphabet (a to z and A-Z) or not. If a character passed to isalpha() is an alphabet, it returns a non-zero integer, if not it returns 0. The isalpha() function is defined in <ctype. h> header file.
If you are not using reflection to access your propery/class, you can use Shift + F12 or right click on the property/class/field and choose 'Find all references'.
This will open up the 'Find symbol results' window where you can see all references to your code element.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With