Ejemplo n.º 1
0
        public void AssertException_WithWrongMessage()
        {
            //Arrange
            Action action = () => throw new ArgumentNullException(Guid.NewGuid().ToString());

            // Action
            ActionExtensions.AssertException <ArgumentNullException>(action, Guid.NewGuid().ToString());
        }
Ejemplo n.º 2
0
        public void AssertException_WithWrongExceptionType()
        {
            //Arrange
            Action action = () => throw new NotImplementedException();

            // Action
            ActionExtensions.AssertException <Exception>(action);
        }
Ejemplo n.º 3
0
        public void AssertException_WithNotThrowingException()
        {
            //Arrange
            Action action = () => { Assert.AreEqual(string.Empty, string.Empty); };

            // Action
            ActionExtensions.AssertException <Exception>(action);
        }
Ejemplo n.º 4
0
        public void AssertException_WithActionNull()
        {
            //Arrange
            Action action = null;

            // Action
            ActionExtensions.AssertException <Exception>(action);
        }
Ejemplo n.º 5
0
        public void AssertException_WithMatchingExceptionTypeAndMessage()
        {
            //Arrange
            var    exception = new InvalidOperationException(Guid.NewGuid().ToString());
            Action action    = () => throw exception;

            // Action
            ActionExtensions.AssertException <InvalidOperationException>(action, exception.Message);
        }