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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -