public bool WasEventAlreadyClosed(TestExecutionMethodClientEvent message)
 {
     return(_completedMessage.Any(a =>
                                  a.NamespaceName == message.NamespaceName &&
                                  a.ClassName == message.ClassName &&
                                  a.MethodName == message.MethodName));
 }
示例#2
0
 private static TestExecutionMethodClientEvent PopulateCoreInfo(TestExecutionMethodClientEvent testExecutionMethodClientEvent, MethodInfo method)
 {
     testExecutionMethodClientEvent.NamespaceName = method.ReflectedType.Namespace;
     testExecutionMethodClientEvent.ClassName     = method.ReflectedType.ClassNameIncludingParentsIfNested();
     testExecutionMethodClientEvent.MethodName    = method.Name;
     return(testExecutionMethodClientEvent);
 }
示例#3
0
        public static void AssignTestExecutionMethodInfo(this TestExecutionMethodClientEvent testExecutionMethodClientEvent, ITestMethod testMethod)
        {
            var methodInfo = testMethod.Method;

            testExecutionMethodClientEvent.NamespaceName = methodInfo.ReflectedType.Namespace;
            testExecutionMethodClientEvent.ClassName     = methodInfo.ReflectedType.ClassNameIncludingParentsIfNested();
            testExecutionMethodClientEvent.MethodName    = testMethod.Name;
        }
示例#4
0
 public void AddEvent(TestExecutionMethodClientEvent clientEvent, Action actionOnCompletion)
 {
     lock (_sync)
     {
         if (_awaitingForAMatch.ContainsKey(clientEvent.FullMethodName))
         {
             _awaitingForAMatch.Remove(clientEvent.FullMethodName);
             actionOnCompletion();
         }
         else
         {
             _awaitingForAMatch.Add(clientEvent.FullMethodName, actionOnCompletion);
         }
     }
 }
示例#5
0
        public static void AssignMetadata(this TestExecutionMethodClientEvent testExecutionMethodClientEvent, MethodInfo methodInfo)
        {
            var descriptionAttribute = methodInfo.GetAttribute <DescriptionAttribute>().FirstOrDefault();

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

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

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

            foreach (var testPropertyAttribute in methodInfo.GetAttribute <TestPropertyAttribute>())
            {
                testExecutionMethodClientEvent.AddMetadata("TestProperty", testPropertyAttribute.Name, testPropertyAttribute.Value);
            }
        }
示例#6
0
 private static void TranslateCoreInfo(ref TestCaseResultServerEvent resultServerEvent, TestExecutionMethodClientEvent message)
 {
     resultServerEvent.ClassName     = message.ClassName;
     resultServerEvent.NamespaceName = message.NamespaceName;
     resultServerEvent.MethodName    = message.MethodName;
     resultServerEvent.PopulateMetadata(message.Metadata);
 }