it seems that there are no delegates. Is there any convenient way to do the following?
Assert.Throws<InvalidOperationException>( delegate { // Current is a property as we all know nullNodeList.GetEnumerator().Current; });
Fast forward four years and now NUnit supports this (current version v2.6 - I did not check which version was introduced).
Assert.That(() => nullNodeList.GetEnumerator().Current, Throws.InvalidOperationException);
Assert.Throws<InvalidOperationException>( delegate { object current = nullNodeList.GetEnumerator().Current; });
why not say:
Assert.Throws<InvalidOperationException>( () => nullNodeList.GetEnumerator().Current);
You can try to assign it to a variable or try to list:
Assert.Throws<InvalidOperationException>(delegate { // Current is a property as we all know object current = nullNodeList.GetEnumerator().Current; });