Example #1
0
        public void ActionMethod()
        {
            Action a = () =>
            {
                Assert.AreEqual(nameof(CallerQuerierTest), CallerQuerier.GetCurrent().TypeName);
            };

            a();
            Action <int> b = (x) =>
            {
                a();
            };

            b(1);
        }
Example #2
0
        public void FuncMethod()
        {
            Func <int> a = () =>
            {
                Assert.AreEqual(nameof(CallerQuerierTest), CallerQuerier.GetCurrent().TypeName);
                return(1);
            };

            a();
            Func <int, int> b = (x) =>
            {
                a();
                return(x);
            };

            b(1);
        }
Example #3
0
 public void Event()
 {
     TestEvent += (s, e) => Assert.AreEqual(nameof(CallerQuerierTest), CallerQuerier.GetCurrent().TypeName);
     TestEvent?.Invoke(this, new EventArgs());
 }
Example #4
0
 public void NormalMethod()
 {
     Assert.AreEqual(nameof(CallerQuerierTest), CallerQuerier.GetCurrent().TypeName);
 }
Example #5
0
 public void OtherClass_Called(object?sender, EventArgs e)
 {
     Assert.AreEqual(nameof(OtherClass), CallerQuerier.GetCurrent().TypeName);
 }