Created
September 25, 2013 01:58
-
-
Save sebmaldo/6694227 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void ProbandoSumadorEstaticoPrivado() | |
{ | |
//Se crea una clase PriveteType que envuelve a la clase Matemática | |
//para luego poder invocar su método estático privado | |
var privateTest = new PrivateType(typeof(Matematica)); | |
//Se utiliza el método invocar estático para invocar y su resultado | |
//se almacena en la variable obj | |
object obj = privateTest.InvokeStatic("SumaNumeros", 1, 4); | |
//Se testea el retorno del método en el objeto obj. | |
Assert.AreEqual(10, (int) obj); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment