public void throw_exception_generics_com_delegate_e_mensagem() { string errorMessage = "message"; string throwingMessage = string.Empty; try { FakeAssert assert = new FakeAssert(); TestDelegate test = new TestDelegate(FazerNada); assert.Throws<Exception>(test, errorMessage); } catch (Exception ex) { throwingMessage = ex.Message; } Assert.AreEqual(throwingMessage, errorMessage); }
public void throws_type__nao_deve_retornar_execao() { IAssert Assert = new FakeAssert(); object[] lista = new object[0]; Type expression = typeof(IAssert); TestDelegate test = new TestDelegate(FazerNada); Assert.Throws(expression, test); }
public void throw_exception_com_generics_utilizando_delegate_com_mensagem_e_array_de_parametros() { string errorMessage = "message"; string throwingMessage = string.Empty; try { IAssert assert = new FakeAssert(); ResolvableConstraintExpression expression = new ResolvableConstraintExpression(); TestDelegate test = new TestDelegate(FazerNada); assert.Throws<Exception>(test, errorMessage, true, true, true, true, true); } catch (Exception ex) { throwingMessage = ex.Message; } Assert.AreEqual(throwingMessage, errorMessage); }
public void throws_nao_deve_retornar_execao() { IAssert Assert = new FakeAssert(); object[] lista = new object[0]; ResolvableConstraintExpression expression = new ResolvableConstraintExpression(); TestDelegate test = new TestDelegate(FazerNada); Assert.Throws(expression, test); }