Ejemplo n.º 1
0
 private static TestExecutionMethod PopulateCoreInfo(TestExecutionMethod testExecutionMethod, MethodInfo method)
 {
     testExecutionMethod.NamespaceName = method.ReflectedType.Namespace;
     testExecutionMethod.ClassName     = method.ReflectedType.ClassNameIncludingParentsIfNested();
     testExecutionMethod.MethodName    = method.Name;
     return(testExecutionMethod);
 }
 public bool WasEventAlreadyClosed(TestExecutionMethod message)
 {
     return(_completedMessage.Any(a =>
                                  a.NamespaceName == message.NamespaceName &&
                                  a.ClassName == message.ClassName &&
                                  a.MethodName == message.MethodName));
 }
Ejemplo n.º 3
0
 private static void TranslateCoreInfo(ref TestCaseResult result, TestExecutionMethod message)
 {
     result.ClassName     = message.ClassName;
     result.NamespaceName = message.NamespaceName;
     result.MethodName    = message.MethodName;
     result.PopulateMetadata(message.Metadata);
 }
Ejemplo n.º 4
0
        public static void AssignTestExecutionMethodInfo(this TestExecutionMethod testExecutionMethod, ITestMethod testMethod)
        {
            var methodInfo = testMethod.Method;

            testExecutionMethod.NamespaceName = methodInfo.ReflectedType.Namespace;
            testExecutionMethod.ClassName     = methodInfo.ReflectedType.ClassNameIncludingParentsIfNested();
            testExecutionMethod.MethodName    = testMethod.Name;
        }
Ejemplo n.º 5
0
 public void AddEvent(TestExecutionMethod clientEvent, Action actionOnCompletion)
 {
     lock (_sync)
     {
         if (_awaitingForAMatch.ContainsKey(clientEvent.FullMethodName))
         {
             _awaitingForAMatch.Remove(clientEvent.FullMethodName);
             actionOnCompletion();
         }
         else
         {
             _awaitingForAMatch.Add(clientEvent.FullMethodName, actionOnCompletion);
         }
     }
 }
Ejemplo n.º 6
0
        public static void AssignMetadata(this TestExecutionMethod testExecutionMethod, MethodInfo methodInfo)
        {
            var descriptionAttribute = methodInfo.GetAttribute <DescriptionAttribute>().FirstOrDefault();

            if (descriptionAttribute != null)
            {
                testExecutionMethod.AddMetadata("Description", descriptionAttribute.Description, "Description");
            }

            var ownerAttribute = methodInfo.GetAttribute <OwnerAttribute>().FirstOrDefault();

            if (ownerAttribute != null)
            {
                testExecutionMethod.AddMetadata("Owner", ownerAttribute.Owner, "Owner");
            }

            foreach (var testPropertyAttribute in methodInfo.GetAttribute <TestPropertyAttribute>())
            {
                testExecutionMethod.AddMetadata("TestProperty", testPropertyAttribute.Name, testPropertyAttribute.Value);
            }
        }