Esempio n. 1
0
 public void IsActiveMatchesStackState()
 {
     Assert.IsFalse(AopContext.IsActive);
     AopContext.PushProxy("Foo");
     Assert.IsTrue(AopContext.IsActive);
     AopContext.PopProxy();
     Assert.IsFalse(AopContext.IsActive);
 }
Esempio n. 2
0
 public void SetUp()
 {
     // makes sure the context is always empty before any unit test...
     try
     {
         do
         {
             AopContext.PopProxy();
         } while (true);
     }
     catch (AopConfigException)
     {
     }
 }
Esempio n. 3
0
        public void CurrentProxyStackJustPeeksItDoesntPop()
        {
            string foo = "Foo";

            AopContext.PushProxy(foo);
            object fooref = AopContext.CurrentProxy;

            Assert.IsTrue(ReferenceEquals(foo, fooref),
                          "Not the exact same instance (must be).");
            // must not have been popped off the stack by looking at it...
            object foorefref = AopContext.CurrentProxy;

            Assert.IsTrue(ReferenceEquals(fooref, foorefref),
                          "Not the exact same instance (must be).");
        }
Esempio n. 4
0
 public void PopProxyWithNothingOnStack()
 {
     AopContext.PopProxy();
 }
Esempio n. 5
0
 public void PopProxyWithNothingOnStack()
 {
     Assert.Throws <AopConfigException>(() => AopContext.PopProxy());
 }