mardi 27 octobre 2015

Ignore nullable in the unit test

Is there any way to ignore if the property is nullable? I Need to assert two sets of properties. One of example pair is:

   public Field<DateTime?> RegistrationFrom { get; set; } 

and

   public DateTime RegistrationFrom { get; set; }

But I only check their types.

I tested like that:

 Assert.AreEqual(BaseProperties.PropertyType, typeof(Field<>).MakeGenericType(prop.PropertyType));

Aucun commentaire:

Enregistrer un commentaire