public void AssertCompositeException_Right_Message_Part() { var to = new TestObserver <int>(); to.OnError(new AggregateException( new InvalidOperationException(), new IndexOutOfRangeException("message_of_part") )); to.AssertCompositeError(1, typeof(IndexOutOfRangeException), "_of_", true); }
public void AssertCompositeException_Wrong_Message_Part() { var to = new TestObserver <int>(); to.OnError(new AggregateException( new InvalidOperationException(), new IndexOutOfRangeException("message_of_part") )); try { to.AssertCompositeError(1, typeof(IndexOutOfRangeException), "_on_", true); Assert.Fail("Should have thrown"); } catch (AssertionException) { throw; } catch (Exception ex) { var msg = ex.Message; Assert.True(msg.Contains("Error found with a different message")); } }
public void AssertCompositeException_Wrong_Error() { var to = new TestObserver <int>(); to.OnError(new AggregateException( new InvalidOperationException(), new IndexOutOfRangeException() )); try { to.AssertCompositeError(1, typeof(NullReferenceException)); Assert.Fail("Should have thrown"); } catch (AssertionException) { throw; } catch (Exception ex) { var msg = ex.Message; Assert.True(msg.Contains("Wrong error type")); } }