c# - Creating a NUnit constraint meaning "{collection} does not contain {item}" -
i'm struggling make assertion absence of particular item in enumeration. specifically, test looks like:
// take item queue of scheduled items... itemqueue pendingqueue = schedule.pendingitems; // pendingitems ienumerable<int> int item = pendingqueue.firstitem; // ...process item... processor.dosomethingwith(item); // ...and schedule must not contain item anymore: assert.that(schedule.pendingitems, does.not.contain(item));
of course, does.not.contain not valid nunit constraint. how can express in valid fluent syntax?
assert.that(schedule.pendingitems, has.no.member(item))
only nunit 2.4 / 2.5
Comments
Post a Comment