コード例 #1
0
ファイル: CallerQuerierTest.cs プロジェクト: ruo-an/AutumnBox
        public void ActionMethod()
        {
            Action a = () =>
            {
                Assert.AreEqual(nameof(CallerQuerierTest), CallerQuerier.GetCurrent().TypeName);
            };

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

            b(1);
        }
コード例 #2
0
ファイル: CallerQuerierTest.cs プロジェクト: ruo-an/AutumnBox
        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);
        }
コード例 #3
0
ファイル: CallerQuerierTest.cs プロジェクト: ruo-an/AutumnBox
 public void Event()
 {
     TestEvent += (s, e) => Assert.AreEqual(nameof(CallerQuerierTest), CallerQuerier.GetCurrent().TypeName);
     TestEvent?.Invoke(this, new EventArgs());
 }
コード例 #4
0
ファイル: CallerQuerierTest.cs プロジェクト: ruo-an/AutumnBox
 public void NormalMethod()
 {
     Assert.AreEqual(nameof(CallerQuerierTest), CallerQuerier.GetCurrent().TypeName);
 }
コード例 #5
0
ファイル: CallerQuerierTest.cs プロジェクト: ruo-an/AutumnBox
 public void OtherClass_Called(object?sender, EventArgs e)
 {
     Assert.AreEqual(nameof(OtherClass), CallerQuerier.GetCurrent().TypeName);
 }