mxmissile
mxmissile

Reputation: 11673

Testing Nullables with PersistenceSpecification

Is it possible to test Nullable Types with PersistenceSpecification?

var approved = new Nullable<DateTime>();
spec.CheckProperty(x => x.Approved, approved);

Currently this throws a NullReferenceException. Am I doing it wrong?

Upvotes: 1

Views: 372

Answers (1)

mhenrixon
mhenrixon

Reputation: 6278

Is possible indeed.

  1. Is approved of type Nullable<DateTime>?
  2. Have you created your own IEqualityComparer?
  3. Could you provide some more code for us to help you?

Upvotes: 1

Related Questions