public void CallInterceptedMethodTwiceShouldReturnTheSameResult()
        {
            var firstResult  = _interceptedObject.DoSomethingElse();
            var secondResult = _interceptedObject.DoSomethingElse();

            Assert.Equal(firstResult, secondResult);
        }
        static void Main(string[] args)
        {
            string key;

            do
            {
                Console.Write("Please enter if you want to use DoHickey (1) or DoDickey(2)");
                key = Console.ReadLine();
            }while(key != "1" && key != "2");

            IDoThings myStuff = key == "1" ? (IDoThings) new DoHickey() : (IDoThings) new DoDickey();

            myStuff.DoNothing();
            myStuff.DoSomething(1);
            myStuff.DoSomethingElse("Hello");
        }
Exemplo n.º 3
0
 public void TestCachedMethodInvocationSignatureWithoutArgs()
 {
     _expectedSignature = "SlidingCacheAop.Tests.ClassThatWillBeIntercepted-DoSomethingElse-";
     _interceptedObject.DoSomethingElse();
 }