Ejemplo n.º 1
0
        private RemoteTaskWrapper GetTheoryTask(ITestMethod testMethod, string displayName)
        {
            // Normalise the display name to ensure it doesn't have a type prefix
            // TODO: Why do we care about normalising the name?
            // Would make the code easier if we didn't have to. Could pass ITestCase here
            var prefix     = testMethod.TestClass.Class.Name + ".";
            var theoryName = displayName.StartsWith(prefix) ? displayName.Substring(prefix.Length) : displayName;

            var fullyQualifiedMethodName = testMethod.FullyQualifiedName();
            var key = string.Format("{0}-{1}", fullyQualifiedMethodName, theoryName);

            lock (lockObject)
            {
                RemoteTaskWrapper task;
                if (tasksByTheoryId.TryGetValue(key, out task))
                {
                    return(task);
                }

                task = CreateDynamicTheoryTask(testMethod, theoryName);
                AddTheoryTask(key, fullyQualifiedMethodName, task);

                return(task);
            }
        }
Ejemplo n.º 2
0
        private RemoteTaskWrapper GetTheoryTask(ITestMethod testMethod, string displayName)
        {
            // Normalise the display name to ensure it doesn't have a type prefix
            // TODO: Why do we care about normalising the name?
            // Would make the code easier if we didn't have to. Could pass ITestCase here
            var prefix = testMethod.TestClass.Class.Name + ".";
            var theoryName = displayName.StartsWith(prefix) ? displayName.Substring(prefix.Length) : displayName;

            var fullyQualifiedMethodName = testMethod.FullyQualifiedName();
            var key = string.Format("{0}-{1}", fullyQualifiedMethodName, theoryName);

            lock (lockObject)
            {
                RemoteTaskWrapper task;
                if (tasksByTheoryId.TryGetValue(key, out task))
                    return task;

                task = CreateDynamicTheoryTask(testMethod, theoryName);
                AddTheoryTask(key, fullyQualifiedMethodName, task);

                return task;
            }
        }