Exemplo n.º 1
0
        public static LinkerMethodInfo GetMethodInfo(TypeSystem typeSystem, MosaLinker linker, UnitTestInfo unitTestInfo)
        {
            string fullMethodName = unitTestInfo.FullMethodName;

            int first  = fullMethodName.LastIndexOf(".");
            int second = fullMethodName.LastIndexOf(".", first - 1);

            var methodNamespaceName = fullMethodName.Substring(0, second);
            var methodTypeName      = fullMethodName.Substring(second + 1, first - second - 1);
            var methodName          = fullMethodName.Substring(first + 1);

            var method = FindMosaMethod(
                typeSystem,
                methodNamespaceName,
                methodTypeName,
                methodName,
                unitTestInfo.Values);

            var address = GetMethodAddress(method, linker);

            var methodInfo = new LinkerMethodInfo
            {
                MethodNamespaceName = methodNamespaceName,
                MethodTypeName      = methodTypeName,
                MethodName          = methodName,
                MosaMethod          = method,
                MosaMethodAddress   = address
            };

            return(methodInfo);
        }
Exemplo n.º 2
0
        public UnitTest(UnitTestInfo unitTestInfo, LinkerMethodInfo linkerMethodInfo)
        {
            UnitTestInfo     = unitTestInfo;
            LinkerMethodInfo = linkerMethodInfo;

            Status = unitTestInfo.Skip ? UnitTestStatus.Skipped : UnitTestStatus.Pending;
        }