public void throwException() { //Arrange string IbanNumber = "2734471529361444"; bool exceptionThrown = true; //Act try { Iban.IsPaldindrome(IbanNumber); } catch (ExpectedExceptionAttribute) { exceptionThrown = true; } //Assert Assert.IsTrue(exceptionThrown); }