c# - Testing properties with reflection using attributes -


I am trying to create a nUnit test to do the following:

1) DLL load To check out. 2) Explosions between different types.
3) Find people who have a specific custom feature. 4) Instant these types and ensure that all their public properties are not empty.

Even what I have written:

  assembly assembly = assembly Loadfile ("MyLib.dll"); Leading type (type type in assembly). Gatetype (if) (if type.GetCustomAttributes (typeof (CustomAttribute), wrong) .Lang! = 0) {Object example = Activator.CreateInstance (type); Foreach (PropertyInfo propertyInfo type.GetProperties ()) {// How to go from here? }}}  

As you can see that I do not know how to complete the test for the tap, suppose the rest of the code is correct.

Getting value works like this:

  Object value = propertyInfo.GetValue (example, blank); If (value == faucet) // tap value and if (DBNull.Value.Equals (value)) // DB tap  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -