This question already has an answer here:
- Loop through constant members of a class 6 answers
This SO post talks about properties however I am trying to get at the constants in the following static class:
public static class SpYtMessageConstants
{
public const int MSG_NOOP = 1;
public const int MSG_PING = 2;
}
I want to loop through all the constants and get each value values. This is for a unit test to make sure nobody has added the same value twice.
Aucun commentaire:
Enregistrer un commentaire