Beispiel #1
0
        private void ProcessCandidateAssembly(string filePath, bool fromWildCard)
        {
            if (!Visited(filePath))
            {
                Visit(filePath);

                try
                {
                    var candidate = new ExtensionAssembly(filePath, fromWildCard);

                    for (int i = 0; i < _assemblies.Count; i++)
                    {
                        var assembly = _assemblies[i];

                        if (candidate.IsDuplicateOf(assembly))
                        {
                            if (candidate.IsBetterVersionOf(assembly))
                            {
                                _assemblies[i] = candidate;
                            }

                            return;
                        }
                    }

                    _assemblies.Add(candidate);
                }
                catch (BadImageFormatException e)
                {
                    if (!fromWildCard)
                    {
                        throw new NUnitEngineException(String.Format("Specified extension {0} could not be read", filePath), e);
                    }
                }
                catch (NUnitEngineException)
                {
                    if (!fromWildCard)
                    {
                        throw;
                    }
                }
            }
        }
 public void IsDuplicateOf_DifferentAssembly()
 {
     Assert.False(_ea.IsDuplicateOf(_eaOther));
     Assert.False(_eaOther.IsDuplicateOf(_ea));
 }
 public void IsDuplicateOf_SameAssembly()
 {
     Assert.That(_ea.IsDuplicateOf(_eaCopy));
     Assert.That(_eaCopy.IsDuplicateOf(_ea));
 }