public void AssertionsPassIfNoErrors() { var noErrors = new ProjectException[0]; noErrors.Assert(); noErrors.Assert(s => new Exception(s)); noErrors.AssertThrowsFirst(); }
public void AssertionsFailIfErrors() { var first = new UnknownComponentException("First"); var second = new UnknownLayerException("Second"); var errors = new ProjectException[] { first, second }; Assert.Throws <Exception>(() => errors.Assert()); Assert.Throws <AssertionException>(() => errors.Assert(s => new AssertionException(s))); var e = Assert.Throws <UnknownComponentException>(() => errors.AssertThrowsFirst()); Assert.AreEqual(first, e); }