Esempio n. 1
0
        public void CanDetermineCallContext()
        {
            CallStackAnalyzer.CalledBy(0, out var fullyQualifiedClassName, out var isStatic, out var constructor);
            Assert.IsFalse(isStatic);
            Assert.IsFalse(constructor);
            Assert.AreEqual(typeof(CallStackAnalyzerTest).Namespace + '.' + nameof(CanDetermineCallContext), fullyQualifiedClassName);

            var testObject = new CallStackAnalyzerTestObject();

            Assert.IsNotNull(testObject);
            Assert.IsTrue(CallStackAnalyzerTestObject.Constructor);
            Assert.IsFalse(CallStackAnalyzerTestObject.IsStatic);
            Assert.AreEqual(typeof(CallStackAnalyzerTest).Namespace + "..ctor", CallStackAnalyzerTestObject.FullyQualifiedMethodName);

            CallStackAnalyzerTestObject.RegisterTypes();
            Assert.IsFalse(CallStackAnalyzerTestObject.Constructor);
            Assert.IsTrue(CallStackAnalyzerTestObject.IsStatic);
            Assert.AreEqual(typeof(CallStackAnalyzerTest).Namespace + '.' + nameof(CallStackAnalyzerTestObject.RegisterTypes), CallStackAnalyzerTestObject.FullyQualifiedMethodName);
        }
Esempio n. 2
0
 internal static void RegisterTypes()
 {
     CallStackAnalyzer.CalledBy(0, out FullyQualifiedMethodName, out IsStatic, out Constructor);
 }
Esempio n. 3
0
 internal CallStackAnalyzerTestObject()
 {
     CallStackAnalyzer.CalledBy(0, out FullyQualifiedMethodName, out IsStatic, out Constructor);
 }