Exemple #1
0
        public void TestMiException()
        {
            //Arrange
            OtraClase clasePrueba;
            bool      capturoException = false;

            //Act
            try
            {
                clasePrueba = new OtraClase();
                clasePrueba.MiMetodoDeInstancia();
            }
            catch (Exception e)
            {
                //Assert
                Assert.IsInstanceOfType(e, typeof(MiException));
                capturoException = true;
            }

            if (capturoException == false)
            {
                Assert.Fail();
            }
        }