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! }
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); }
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); }