public void AssertException_WithWrongMessage() { //Arrange Action action = () => throw new ArgumentNullException(Guid.NewGuid().ToString()); // Action ActionExtensions.AssertException <ArgumentNullException>(action, Guid.NewGuid().ToString()); }
public void AssertException_WithWrongExceptionType() { //Arrange Action action = () => throw new NotImplementedException(); // Action ActionExtensions.AssertException <Exception>(action); }
public void AssertException_WithNotThrowingException() { //Arrange Action action = () => { Assert.AreEqual(string.Empty, string.Empty); }; // Action ActionExtensions.AssertException <Exception>(action); }
public void AssertException_WithActionNull() { //Arrange Action action = null; // Action ActionExtensions.AssertException <Exception>(action); }
public void AssertException_WithMatchingExceptionTypeAndMessage() { //Arrange var exception = new InvalidOperationException(Guid.NewGuid().ToString()); Action action = () => throw exception; // Action ActionExtensions.AssertException <InvalidOperationException>(action, exception.Message); }