From: Marek Safar Date: Mon, 17 Feb 2014 16:56:55 +0000 (+0100) Subject: Merge pull request #900 from Blewzman/FixAggregateExceptionGetBaseException X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=5ad1099341581dee94f77b32db728918e90fa64f;hp=3646f687fe42a170d8960dee624dd1e6b55eb2b4;p=mono.git Merge pull request #900 from Blewzman/FixAggregateExceptionGetBaseException Add unit test for AggregateException.GetBaseException that works on .net but is broken on Mono. --- diff --git a/mcs/class/corlib/Test/System/AggregateExceptionTests.cs b/mcs/class/corlib/Test/System/AggregateExceptionTests.cs index d133a82cd86..67cedafbbb4 100644 --- a/mcs/class/corlib/Test/System/AggregateExceptionTests.cs +++ b/mcs/class/corlib/Test/System/AggregateExceptionTests.cs @@ -119,6 +119,14 @@ namespace MonoTests.System Assert.AreEqual (expected, ae2.GetBaseException ().InnerException, "#2"); } + [Test] + public void GetBaseException_stops_at_first_inner_exception_that_is_not_AggregateException() + { + var inner = new ArgumentNullException(); + var outer = new InvalidOperationException("x", inner); + Assert.AreEqual(outer, new AggregateException(outer).GetBaseException()); + } + static void Throws (Type t, Action action) { Exception e = null;