MudassarRasool / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

Assert.DoesNotExist #804

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Missing the counterpart of Assert.Exists.

The assert passes if none of the elements of the sequence make the predicate 
return true.

[Test]
public void DoesNotExist()
{
   void array = new[] { 2, 4, 6, 8, 10 };
   Assert.DoesNotExist(array, i => i % 2 == 1); // Pass!
   Assert.DoesNotExist(array, i => i % 2 == 0); // Fail!
}

Original issue reported on code.google.com by Yann.Tre...@gmail.com on 31 Jan 2011 at 10:31

GoogleCodeExporter commented 8 years ago
Well, in fact. The same can be done with Assert.ForAll.

Original comment by Yann.Tre...@gmail.com on 31 Jan 2011 at 10:48

GoogleCodeExporter commented 8 years ago

Original comment by Jonathan...@gmail.com on 5 Feb 2011 at 7:28

GoogleCodeExporter commented 8 years ago
Let's merge this to v3.2.3

Original comment by Yann.Tre...@gmail.com on 8 Feb 2011 at 6:41

GoogleCodeExporter commented 8 years ago

Original comment by Jonathan...@gmail.com on 8 Feb 2011 at 1:35