Ejemplo n.º 1
0
        public void SubvertPrivateMethods()
        {
            InnerSecret secret             = new InnerSecret();
            string      superSecretMessage = secret.GetType()
                                             .GetMethod("SooperSeekrit", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)
                                             .Invoke(secret, null) as string;

            Assert.Equal("No one will find me!", superSecretMessage);      //ANCA: Need some help figuring out the narrative of this code block!
        }
Ejemplo n.º 2
0
        public void SubvertPrivateMethods()
        {
            InnerSecret secret             = new InnerSecret();
            string      superSecretMessage = secret.GetType()
                                             .GetMethod("SooperSeekrit", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)
                                             .Invoke(secret, null) as string;

            Assert.Equal("No one will find me!", superSecretMessage);
        }
Ejemplo n.º 3
0
        public void AboutMethodsSubvertPrivateMethods()
        {
            InnerSecret secret             = new InnerSecret();
            string      superSecretMessage = secret.GetType()
                                             .GetMethod("SooperSeekrit", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)
                                             .Invoke(secret, null) as string;

            Assert.AreEqual(FILL_ME_IN, superSecretMessage);
        }