public MetadataComparer(
            [NotNull] AssemblyReference examineeAssemblyReference,
            [NotNull] ICollection <AssemblyReference> comparandAssemblyReferences,
            [NotNull] MetadataComparisonParameters parameters)
        {
            if (examineeAssemblyReference == null)
            {
                throw new ArgumentNullException(nameof(examineeAssemblyReference));
            }

            if (comparandAssemblyReferences == null)
            {
                throw new ArgumentNullException(nameof(comparandAssemblyReferences));
            }

            if (comparandAssemblyReferences.Any(item => item == null))
            {
                throw new ArgumentException(
                          @"The collection contains a null element.",
                          nameof(comparandAssemblyReferences));
            }

            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            ExamineeAssemblyReference   = examineeAssemblyReference;
            ComparandAssemblyReferences = comparandAssemblyReferences.ToArray().AsReadOnly();
            Parameters = parameters;
        }
Beispiel #2
0
        public void TestProofOfConceptScenario()
        {
            var examineeAssemblyReference =
                new FileSystemAssemblyReference(
                    @"C:\Src\Tfs\MobiControl\Common\DeploymentServerExtensions.Facade\v1\DeploymentServerExtensions.Facade\bin\Debug\Soti.MobiControl.DeploymentServerExtensions.Facade.dll");

            var comparandAssemblyPaths = new[]
            {
                @"C:\Src\Tfs\MobiControl\DEV\MobiControl\Lib\Soti.MobiControl.Entities.dll",
                @"C:\Src\Tfs\MobiControl\DEV\MobiControl\Lib\Soti.MobiControl.Api.dll",
                @"C:\Src\Tfs\MobiControl\DEV\MobiControl\Lib\Soti.MobiControl.CoreFeatures.dll",
                @"C:\Src\Tfs\MobiControl\DEV\MobiControl\Lib\Soti.MobiControl.DeviceConfiguration.dll",
                @"C:\Src\Tfs\MobiControl\DEV\MobiControl\Lib\Soti.MobiControl.Entities.Providers.dll",
                @"C:\Src\Tfs\MobiControl\DEV\MobiControl\Lib\Soti.MobiControl.WindowsModern.Service.dll",
                @"C:\Src\Tfs\MobiControl\DEV\MobiControl\Lib\Soti.MobiControl.DeploymentServerExtensions.dll"
            };

            var comparandAssemblyReferences = comparandAssemblyPaths
                                              .Select(path => new FileSystemAssemblyReference(path))
                                              .ToArray();

            var dependencyReferences = new DependencyReference[]
            {
                new DirectoryDependencyReference(@"C:\Src\Tfs\MobiControl\DEV\MobiControl\Packages", true)
            };

            var parameters = new MetadataComparisonParameters(dependencyReferences: dependencyReferences);

            var comparer         = new MetadataComparer(examineeAssemblyReference, comparandAssemblyReferences, parameters);
            var comparisonResult = comparer.Compare();

            Assert.That(comparisonResult, Is.Not.Null);
        }
 public MetadataComparer(
     [NotNull] AssemblyReference examineeAssemblyReference,
     [NotNull] AssemblyReference comparandAssemblyReference,
     [NotNull] MetadataComparisonParameters parameters)
     : this(examineeAssemblyReference, comparandAssemblyReference.AsArray(), parameters)
 {
     // Nothing to do
 }