Example #1
0
 public void Create(out IResultKey @object,
                    String assemblyName,
                    RuntimeInfo targetRuntime,
                    ProcessorArchitecture targetArchitecture,
                    RuntimeInfo executionRuntime,
                    ProcessorArchitecture executionArchitecture,
                    String fileName,
                    String methodName) => @object = new ResultKey(assemblyName, targetRuntime, targetArchitecture, executionRuntime, executionArchitecture, fileName, methodName);
Example #2
0
        /// <summary>
        /// Appends <paramref name="data"/> to the <see cref="Payload"/> <see cref="MemoryStream"/>.
        /// </summary>
        /// <param name="data">The data object.</param>
        /// <returns>The current <see cref="IMessage"/>.</returns>
        public IMessage Append(IResultKey data)
        {
            Append(data.AssemblyName);
            Append(data.TargetRuntime.Framework);
            Append(data.TargetRuntime.Version.ToString());
            Append(data.TargetArchitecture);
            Append(data.ExecutionRuntime.Framework);
            Append(data.ExecutionRuntime.Version.ToString());
            Append(data.ExecutionArchitecture);
            Append(data.FileName);
            Append(data.MethodName);

            return(this);
        }
Example #3
0
        public Boolean Equals(IResultKey other)
        {
            if (other == null)
            {
                return(false);
            }

            if (other.AssemblyName != AssemblyName)
            {
                return(false);
            }
            if (other.TargetRuntime != TargetRuntime)
            {
                return(false);
            }
            if (other.TargetArchitecture != TargetArchitecture)
            {
                return(false);
            }
            if (other.ExecutionRuntime != ExecutionRuntime)
            {
                return(false);
            }
            if (other.ExecutionArchitecture != ExecutionArchitecture)
            {
                return(false);
            }
            if (other.FileName != FileName)
            {
                return(false);
            }
            if (other.MethodName != MethodName)
            {
                return(false);
            }

            return(true);
        }
Example #4
0
 public IEnumerable <ITestMethodResult> GetResults(IResultKey match) => _results.Where(kvp => kvp.Key.Equals(match)).Select(value => value.Value);
Example #5
0
        public ITestMethodResult GetResult(IResultKey key)
        {
            Factory.Instance.Create(out ITestMethodResult result);

            return(_results.GetOrAdd(key, result));
        }
Example #6
0
 public IEnumerable <IResultKey> GetKeys(IResultKey match) => GetKeys().Where(key => key.Equals(match));
Example #7
0
        public void Add(IResultKey key, ITestMethodResult results)
        {
            _log.Debug($"{nameof(Add)}({key.Format()}, {results.CountEntries.Format()})");

            _results.AddOrUpdate(key, results, (_, __) => results);
        }
Example #8
0
 public void Create(out IResultKey @object, ITestScenario scenario, String fileName, String methodName) => @object = new ResultKey(scenario, fileName, methodName);
Example #9
0
 public void Create(out IResultKey @object, ITestScenario scenario, MethodInfo methodInfo) => @object = new ResultKey(scenario, methodInfo);
Example #10
0
        public Int32 CompareTo(IResultKey other)
        {
            if (!Equals(other))
            {
                Int32 result = AssemblyName.CompareTo(other.AssemblyName);
                if (result != 0)
                {
                    return(result);
                }

                result = TargetRuntime.Framework.CompareTo(other.TargetRuntime.Framework);
                if (result != 0)
                {
                    return(result);
                }

                result = TargetRuntime.Version.CompareTo(other.TargetRuntime.Version);
                if (result != 0)
                {
                    return(result);
                }

                result = TargetArchitecture.CompareTo(other.TargetArchitecture);
                if (result != 0)
                {
                    return(result);
                }

                result = ExecutionRuntime.Framework.CompareTo(other.ExecutionRuntime.Framework);
                if (result != 0)
                {
                    return(result);
                }

                result = ExecutionRuntime.Version.CompareTo(other.ExecutionRuntime.Version);
                if (result != 0)
                {
                    return(result);
                }

                result = ExecutionArchitecture.CompareTo(other.ExecutionArchitecture);
                if (result != 0)
                {
                    return(result);
                }

                result = FileName.CompareTo(other.FileName);
                if (result != 0)
                {
                    return(result);
                }

                result = MethodName.CompareTo(other.MethodName);
                if (result != 0)
                {
                    return(result);
                }
            }

            return(0);
        }